Skip to content

Commit 5251d0e

Browse files
committed
Changed the handling of the consent field of /account/profile/ to only be required set when information requiring consent is present.
- Legacy-Id: 15261
1 parent 5063248 commit 5251d0e

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

ietf/ietfauth/forms.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,6 @@ def __init__(self, *args, **kwargs):
116116
if f in self.fields:
117117
self.fields[f].label += ' \u2020'
118118

119-
self.fields["consent"].required = True
120-
121119
self.unidecoded_ascii = False
122120

123121
if self.data and not self.data.get("ascii", "").strip():
@@ -150,8 +148,13 @@ def clean_ascii_short(self):
150148

151149
def clean_consent(self):
152150
consent = self.cleaned_data.get('consent')
153-
if consent == False:
154-
raise forms.ValidationError("In order to modify your profile data, you must permit the IETF to use the uploaded data.")
151+
require_consent = (
152+
self.cleaned_data.get('name') != person.name_from_draft
153+
or self.cleaned_data.get('ascii') != person.name_from_draft
154+
or self.cleaned_data.get('biography')
155+
)
156+
if consent == False and require_consent:
157+
raise forms.ValidationError("In order to modify your profile with data that require consent, you must permit the IETF to use the uploaded data.")
155158
return consent
156159

157160
return PersonForm(*args, **kwargs)

0 commit comments

Comments
 (0)