From 4d55e3ae49a134ecad7acdd384e6eb2ddc883511 Mon Sep 17 00:00:00 2001 From: Talitha Pumar Date: Tue, 26 Jun 2018 13:04:09 -0300 Subject: [PATCH] Fix #2043 (#2044) * Fix #2043 * Update forms.py --- sapl/norma/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapl/norma/forms.py b/sapl/norma/forms.py index 5e0eb99ff..610895e09 100644 --- a/sapl/norma/forms.py +++ b/sapl/norma/forms.py @@ -125,7 +125,7 @@ class NormaJuridicaForm(ModelForm): if not self.is_valid(): return cleaned_data - if not self.instance: + if self.instance.numero != cleaned_data['numero']: norma = NormaJuridica.objects.filter(ano=cleaned_data['ano'], numero=cleaned_data['numero'], tipo=cleaned_data['tipo']).exists()