From 9e7abab34ec9d2329ae7157f2ef3bd46041edec8 Mon Sep 17 00:00:00 2001 From: Leandro Roberto da Silva Date: Wed, 30 Nov 2016 15:07:45 -0200 Subject: [PATCH] corrige numero__max --- sapl/protocoloadm/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sapl/protocoloadm/views.py b/sapl/protocoloadm/views.py index 37c4608f8..a97d3d758 100644 --- a/sapl/protocoloadm/views.py +++ b/sapl/protocoloadm/views.py @@ -222,7 +222,7 @@ class ProtocoloDocumentoView(PermissionRequiredMixin, f.tipo_processo = '0' # TODO validar o significado f.anulado = False - f.numero = (numero['numero__max'] + 1) if numero else 1 + f.numero = (numero['numero__max'] + 1) if numero['numero__max'] else 1 f.ano = datetime.now().year f.data = datetime.now().strftime('%Y-%m-%d') f.hora = datetime.now().strftime('%H:%M') @@ -353,7 +353,7 @@ class ProtocoloMateriaView(PermissionRequiredMixin, CreateView): protocolo = Protocolo() - protocolo.numero = (numero['numero__max'] + 1) if numero__max else 1 + protocolo.numero = (numero['numero__max'] + 1) if numero['numero__max'] else 1 protocolo.ano = datetime.now().year protocolo.data = datetime.now().strftime("%Y-%m-%d") protocolo.hora = datetime.now().strftime("%H:%M")