From 5251d0eb787ab340fe4ca2b1d46b006737d87b44 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Thu, 14 Jun 2018 19:28:06 +0000 Subject: [PATCH] Changed the handling of the consent field of /account/profile/ to only be required set when information requiring consent is present. - Legacy-Id: 15261 --- ietf/ietfauth/forms.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ietf/ietfauth/forms.py b/ietf/ietfauth/forms.py index 5349b83c0..ab42fd144 100644 --- a/ietf/ietfauth/forms.py +++ b/ietf/ietfauth/forms.py @@ -116,8 +116,6 @@ def get_person_form(*args, **kwargs): if f in self.fields: self.fields[f].label += ' \u2020' - self.fields["consent"].required = True - self.unidecoded_ascii = False if self.data and not self.data.get("ascii", "").strip(): @@ -150,8 +148,13 @@ def get_person_form(*args, **kwargs): def clean_consent(self): consent = self.cleaned_data.get('consent') - if consent == False: - raise forms.ValidationError("In order to modify your profile data, you must permit the IETF to use the uploaded data.") + require_consent = ( + self.cleaned_data.get('name') != person.name_from_draft + or self.cleaned_data.get('ascii') != person.name_from_draft + or self.cleaned_data.get('biography') + ) + if consent == False and require_consent: + raise forms.ValidationError("In order to modify your profile with data that require consent, you must permit the IETF to use the uploaded data.") return consent return PersonForm(*args, **kwargs)