Browse Source

Muda nome de variave

pull/272/head
Eduardo Edson Batista Cordeiro Alves 9 years ago
parent
commit
e75dff4b99
  1. 10
      protocoloadm/forms.py

10
protocoloadm/forms.py

@ -307,14 +307,14 @@ class ProtocoloMateriaForm(ModelForm):
autor = forms.IntegerField(widget=forms.HiddenInput(), required=False) autor = forms.IntegerField(widget=forms.HiddenInput(), required=False)
def clean_autor(self): def clean_autor(self):
data_autor = self.cleaned_data['autor'] autor_field = self.cleaned_data['autor']
try: try:
autor = Autor.objects.get(id=data_autor) autor = Autor.objects.get(id=autor_field)
except ObjectDoesNotExist: except ObjectDoesNotExist:
data_autor = None autor_field = None
else: else:
data_autor = autor autor_field = autor
return data_autor return autor_field
class Meta: class Meta:
model = Protocolo model = Protocolo

Loading…
Cancel
Save