From 3ac684cd6825979e791c92757d44a49bba0fcb10 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Fri, 4 Mar 2016 15:49:55 -0300 Subject: [PATCH] HOT FIX pesquisa --- protocoloadm/views.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/protocoloadm/views.py b/protocoloadm/views.py index 3df141b1c..f54494152 100644 --- a/protocoloadm/views.py +++ b/protocoloadm/views.py @@ -43,6 +43,7 @@ protocolo_materia_crud = Crud(Protocolo, '') class ProtocoloListView(FormMixin, ListView): template_name = 'protocoloadm/protocolo_list.html' context_object_name = 'protocolos' + form_class = ProtocoloForm model = Protocolo paginate_by = 10 @@ -65,7 +66,7 @@ class ProtocoloListView(FormMixin, ListView): class ProtocoloPesquisaView(FormMixin, GenericView): template_name = 'protocoloadm/protocolo_pesquisa.html' - form_class = ProtocoloForm() + form_class = ProtocoloForm context_object_name = 'protocolos' paginate_by = 10 @@ -175,7 +176,7 @@ class AnularProtocoloAdmView(FormMixin, GenericView): errors = form._errors.setdefault( forms.forms.NON_FIELD_ERRORS, forms.util.ErrorList()) - errors.append(_("Procolo %s/%s já está anulado") + errors.append(_("Procolo %s/%s já encontra-se anulado") % (numero, ano)) return self.form_invalid(form) @@ -189,7 +190,7 @@ class AnularProtocoloAdmView(FormMixin, GenericView): except ObjectDoesNotExist: errors = form._errors.setdefault( forms.forms.NON_FIELD_ERRORS, forms.util.ErrorList()) - errors.append(_("Procolo %s/%s não existe") % (numero, ano)) + errors.append(_("Procolo %s/%s não existe" % (numero, ano))) return self.form_invalid(form) else: return self.form_invalid(form)