Browse Source

HOT FIX pesquisa

pull/242/head
Edward Ribeiro 9 years ago
parent
commit
3ac684cd68
  1. 7
      protocoloadm/views.py

7
protocoloadm/views.py

@ -43,6 +43,7 @@ protocolo_materia_crud = Crud(Protocolo, '')
class ProtocoloListView(FormMixin, ListView): class ProtocoloListView(FormMixin, ListView):
template_name = 'protocoloadm/protocolo_list.html' template_name = 'protocoloadm/protocolo_list.html'
context_object_name = 'protocolos' context_object_name = 'protocolos'
form_class = ProtocoloForm
model = Protocolo model = Protocolo
paginate_by = 10 paginate_by = 10
@ -65,7 +66,7 @@ class ProtocoloListView(FormMixin, ListView):
class ProtocoloPesquisaView(FormMixin, GenericView): class ProtocoloPesquisaView(FormMixin, GenericView):
template_name = 'protocoloadm/protocolo_pesquisa.html' template_name = 'protocoloadm/protocolo_pesquisa.html'
form_class = ProtocoloForm() form_class = ProtocoloForm
context_object_name = 'protocolos' context_object_name = 'protocolos'
paginate_by = 10 paginate_by = 10
@ -175,7 +176,7 @@ class AnularProtocoloAdmView(FormMixin, GenericView):
errors = form._errors.setdefault( errors = form._errors.setdefault(
forms.forms.NON_FIELD_ERRORS, forms.forms.NON_FIELD_ERRORS,
forms.util.ErrorList()) forms.util.ErrorList())
errors.append(_("Procolo %s/%s já está anulado") errors.append(_("Procolo %s/%s já encontra-se anulado")
% (numero, ano)) % (numero, ano))
return self.form_invalid(form) return self.form_invalid(form)
@ -189,7 +190,7 @@ class AnularProtocoloAdmView(FormMixin, GenericView):
except ObjectDoesNotExist: except ObjectDoesNotExist:
errors = form._errors.setdefault( errors = form._errors.setdefault(
forms.forms.NON_FIELD_ERRORS, forms.util.ErrorList()) 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) return self.form_invalid(form)
else: else:
return self.form_invalid(form) return self.form_invalid(form)

Loading…
Cancel
Save