Skip to content

Commit 16ae849

Browse files
committed
Only do state-parent cross-validation on the group edit form when both fields are used on the form. (Many invocations of the form suppress all but one field.) Fixes ietf-tools#2597. Commit ready for merge.
- Legacy-Id: 15681
1 parent 24b8324 commit 16ae849

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

ietf/group/forms.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
# Stdlib imports
55
import re
66

7+
import debug # pyflakes:ignore
8+
79
# Django imports
810
from django import forms
911
from django.utils.html import mark_safe
@@ -200,7 +202,7 @@ def clean(self):
200202
cleaned_data = super(GroupForm, self).clean()
201203
state = cleaned_data.get('state', None)
202204
parent = cleaned_data.get('parent', None)
203-
if state and (state.slug in ['bof', ] and not parent):
205+
if state and (state.slug in ['bof', ] and 'parent' in self.fields and not parent):
204206
raise forms.ValidationError("You requested the creation of a BoF, but specified no parent area. A parent is required when creating a bof.")
205207
return cleaned_data
206208

0 commit comments

Comments
 (0)