From 4f1b7a36badc2fae1287c6e603a853385241ab2b Mon Sep 17 00:00:00 2001 From: Edward Date: Tue, 10 Jul 2018 13:23:25 -0300 Subject: [PATCH] Fixes #2065 (#2066) --- sapl/protocoloadm/forms.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sapl/protocoloadm/forms.py b/sapl/protocoloadm/forms.py index 8502bf334..e7b418253 100644 --- a/sapl/protocoloadm/forms.py +++ b/sapl/protocoloadm/forms.py @@ -708,10 +708,10 @@ class DocumentoAdministrativoForm(ModelForm): ano=ano_protocolo).exists() exist_doc = DocumentoAdministrativo.objects.filter( - protocolo_id=numero_protocolo, - ano=ano_protocolo).exists() + protocolo__numero=numero_protocolo, + protocolo__ano=ano_protocolo).exists() if exist_materia or exist_doc: - raise ValidationError(_('Protocolo %s/%s ja possui' + raise ValidationError(_('Protocolo %s/%s já possui' ' documento vinculado' % (numero_protocolo, ano_protocolo)))