From 2ae6b0b740e990015f78d9fd854edd8460bf0d4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Rodrigues?= Date: Mon, 29 Jun 2020 15:47:27 -0300 Subject: [PATCH] =?UTF-8?q?Adiciona=20corre=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/base/forms.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sapl/base/forms.py b/sapl/base/forms.py index e8960ac83..510c275f6 100644 --- a/sapl/base/forms.py +++ b/sapl/base/forms.py @@ -673,10 +673,8 @@ class AutorForm(ModelForm): self.logger.warn('Nome do Autor não informado.') raise ValidationError( _('O Nome do Autor deve ser informado.')) - - if 'nome' in cd and \ - qs_autor.filter(nome=cd['nome']).exists(): - raise ValidationError("Autor '%s' já existente!" % cd['nome']) + elif qs_autor.filter(nome=cd['nome']).exists(): + raise ValidationError("Autor '%s' já existente!" % cd['nome']) else: if 'autor_related' not in cd or not cd['autor_related']: self.logger.warn(