If an exception is raised earlier in field validation, the

position field may not be set when we get to this point and
try to retrieve the value of a different field than the one
we're processing. Don't cause a new exception in that case.
 - Legacy-Id: 6416
This commit is contained in:
Henrik Levkowetz 2013-10-11 12:31:50 +00:00
parent 3e668a1bca
commit 697dcc450a

View file

@ -103,7 +103,7 @@ class EditPositionForm(forms.Form):
def clean_discuss(self):
entered_discuss = self.cleaned_data["discuss"]
entered_pos = self.cleaned_data["position"]
entered_pos = self.cleaned_data.get("position", "norecord")
if entered_pos.blocking and not entered_discuss:
raise forms.ValidationError("You must enter a non-empty discuss")
return entered_discuss