From ed50c00193f980742d5f877ff13832535298b634 Mon Sep 17 00:00:00 2001 From: Cesar Augusto de Carvalho Date: Mon, 28 Jan 2019 14:09:58 -0200 Subject: [PATCH] fix #2453 (#2457) --- sapl/materia/forms.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sapl/materia/forms.py b/sapl/materia/forms.py index 0e841504b..9a1e4eda7 100644 --- a/sapl/materia/forms.py +++ b/sapl/materia/forms.py @@ -202,7 +202,8 @@ class MateriaLegislativaForm(ModelForm): widget=forms.HiddenInput()) self.fields['autor'] = forms.CharField(required=False, widget=forms.HiddenInput()) - self.fields['numero_protocolo'].widget.attrs['readonly'] = True + if kwargs['instance'].numero_protocolo: + self.fields['numero_protocolo'].widget.attrs['readonly'] = True def clean(self): super(MateriaLegislativaForm, self).clean()