diff --git a/protocoloadm/views.py b/protocoloadm/views.py index 87f0684b9..cab17a4ab 100644 --- a/protocoloadm/views.py +++ b/protocoloadm/views.py @@ -493,7 +493,7 @@ class ProtocoloDocumentoView(FormMixin, GenericView): else: numeracao = Protocolo.objects.all().aggregate(Max('numero')) - if numeracao is None: + if numeracao['numero__max'] is None: numeracao['numero__max'] = 0 protocolo = Protocolo()