Only check state.slug in GroupForm.clean() if state is set.

- Legacy-Id: 11388
This commit is contained in:
Henrik Levkowetz 2016-06-15 20:02:51 +00:00
parent d251692b96
commit 7c033d3daa

View file

@ -137,7 +137,7 @@ class GroupForm(forms.Form):
cleaned_data = super(GroupForm, self).clean()
state = cleaned_data.get('state', None)
parent = cleaned_data.get('parent', None)
if state.slug in ['bof', ] and not parent:
if state and (state.slug in ['bof', ] and not parent):
raise forms.ValidationError("You requested the creation of a BoF, but specified no parent area. A parent is required when creating a bof.")
return cleaned_data