Skip to content

Commit 9b4903e

Browse files
authored
fix: Fix incorrect "GDPR" features/terminology. Fixes ietf-tools#4521. (ietf-tools#4587)
* fix: remove help/personal-information and the prompt-for-consent email management command. * fix: remove gdpr treatment except for consent checkbox. Rename Submit. * fix: drom the consent column from Person and Person.History * fix: remove the consent boolean. Reorganize the account info form. * chore: reorder migrations
1 parent 6653382 commit 9b4903e

17 files changed

Lines changed: 76 additions & 380 deletions

ietf/help/tests_views.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,3 @@ def test_state_index(self):
1919
for name in names:
2020
if not '-' in name:
2121
self.assertIn(name, content)
22-
23-
24-
def test_personal_information_help(self):
25-
r = self.client.get('/help/personal-information')
26-
self.assertContains(r, 'personal information')
27-
self.assertContains(r, 'GDPR')

ietf/help/urls.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# Copyright The IETF Trust 2013-2018, All Rights Reserved
2-
3-
from django.views.generic import TemplateView
1+
# Copyright The IETF Trust 2013-2022, All Rights Reserved
42

53
from ietf.help import views
64
from ietf.utils.urls import url
@@ -9,6 +7,5 @@
97
url(r'^state/(?P<doc>[-\w]+)/(?P<type>[-\w]+)/?$', views.state),
108
url(r'^state/(?P<doc>[-\w]+)/?$', views.state),
119
url(r'^state/?$', views.state_index),
12-
url(r'^personal-information/?$', TemplateView.as_view(template_name='help/personal-information.html'), name='personal-information'),
1310
]
1411

ietf/ietfauth/forms.py

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,7 @@ def get_person_form(*args, **kwargs):
103103
class PersonForm(forms.ModelForm):
104104
class Meta:
105105
model = Person
106-
exclude = exclude_list
107-
widgets = {
108-
'consent': forms.widgets.CheckboxInput,
109-
}
106+
exclude = exclude_list
110107

111108
def __init__(self, *args, **kwargs):
112109
super(PersonForm, self).__init__(*args, **kwargs)
@@ -120,10 +117,6 @@ def __init__(self, *args, **kwargs):
120117

121118
self.fields['pronouns_selectable'] = forms.MultipleChoiceField(label='Pronouns', choices = [(option, option) for option in ["he/him", "she/her", "they/them"]], widget=forms.CheckboxSelectMultiple, required=False)
122119

123-
for f in ['name', 'ascii', 'ascii_short', 'biography', 'photo', 'photo_thumb', 'pronouns_selectable']:
124-
if f in self.fields:
125-
self.fields[f].label = mark_safe(self.fields[f].label + ' <a href="#pi" aria-label="!"><i class="bi bi-exclamation-circle"></i></a>')
126-
127120
self.unidecoded_ascii = False
128121

129122
if self.data and not self.data.get("ascii", "").strip():
@@ -155,19 +148,6 @@ def clean_ascii_short(self):
155148
prevent_system_name(name)
156149
return ascii_cleaner(name)
157150

158-
def clean_consent(self):
159-
consent = self.cleaned_data.get('consent')
160-
require_consent = (
161-
self.cleaned_data.get('name') != person.name_from_draft
162-
or self.cleaned_data.get('ascii') != person.name_from_draft
163-
or self.cleaned_data.get('biography')
164-
or self.cleaned_data.get('pronouns_selectable')
165-
or self.cleaned_data.get('pronouns_freetext')
166-
)
167-
if consent == False and require_consent:
168-
raise forms.ValidationError("In order to modify your profile with data that require consent, you must permit the IETF to use the uploaded data.")
169-
return consent
170-
171151
def clean(self):
172152
if self.cleaned_data.get("pronouns_selectable") and self.cleaned_data.get("pronouns_freetext"):
173153
self.add_error("pronouns_freetext", "Either select from the pronoun checkboxes or provide a custom value, but not both")

ietf/ietfauth/tests.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,6 @@ def test_ietfauth_profile(self):
252252
"pronouns_freetext": "foo/bar",
253253
"affiliation": "Test Org",
254254
"active_emails": email_address,
255-
"consent": True,
256255
}
257256

258257
# edit details - faulty ASCII
@@ -1011,4 +1010,4 @@ def test_has_role_empty_role_names(self):
10111010
"""has_role is False if role_names is empty"""
10121011
role = RoleFactory(name_id='secr', group__acronym='secretariat')
10131012
self.assertTrue(has_role(role.person.user, ['Secretariat']), 'Test is broken')
1014-
self.assertFalse(has_role(role.person.user, []), 'has_role() should return False when role_name is empty')
1013+
self.assertFalse(has_role(role.person.user, []), 'has_role() should return False when role_name is empty')

ietf/ietfauth/views.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
from django.contrib.sites.models import Site
5555
from django.core.exceptions import ObjectDoesNotExist, ValidationError
5656
from django.urls import reverse as urlreverse
57-
from django.utils.safestring import mark_safe
5857
from django.http import Http404, HttpResponseRedirect, HttpResponseForbidden
5958
from django.shortcuts import render, redirect, get_object_or_404
6059
from django.utils.encoding import force_bytes
@@ -699,7 +698,6 @@ def login(request, extra_context=None):
699698
which is not recognized as a valid password hash.
700699
"""
701700

702-
require_consent = []
703701
if request.method == "POST":
704702
form = AuthenticationForm(request, data=request.POST)
705703
username = form.data.get('username')
@@ -721,11 +719,6 @@ def login(request, extra_context=None):
721719
user = u2
722720
#
723721
if user:
724-
try:
725-
if user.person and not user.person.consent:
726-
require_consent = user.person.needs_consent()
727-
except ObjectDoesNotExist:
728-
pass
729722
try:
730723
identify_hasher(user.password)
731724
except ValueError:
@@ -742,18 +735,6 @@ def login(request, extra_context=None):
742735
except Person.DoesNotExist:
743736
logout(request)
744737
response = render(request, 'registration/missing_person.html')
745-
if require_consent:
746-
messages.warning(request, mark_safe(f'''
747-
748-
You have personal information associated with your account which is not
749-
derived from draft submissions or other ietf work, namely: %s. Please go
750-
to your <a href="{urlreverse("ietf.ietfauth.views.profile")}">account profile</a> and review your
751-
personal information, then scoll to the bottom and check the 'confirm'
752-
checkbox and submit the form, in order to to indicate that that the
753-
provided personal information may be used and displayed within the IETF
754-
datatracker.
755-
756-
''' % ', '.join(require_consent)))
757738
return response
758739

759740
@login_required

ietf/person/admin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def plain_name(self, obj):
3636
prefix, first, middle, last, suffix = name_parts(obj.name)
3737
return "%s %s" % (first, last)
3838
list_display = ["name", "short", "plain_name", "time", "user", ]
39-
fields = ("user", "time", "name", "plain", "name_from_draft", "ascii", "ascii_short", "pronouns_selectable", "pronouns_freetext", "biography", "photo", "photo_thumb", "consent",)
39+
fields = ("user", "time", "name", "plain", "name_from_draft", "ascii", "ascii_short", "pronouns_selectable", "pronouns_freetext", "biography", "photo", "photo_thumb",)
4040
readonly_fields = ("name_from_draft", )
4141
search_fields = ["name", "ascii"]
4242
raw_id_fields = ["user"]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright The IETF Trust 2022, All Rights Reserved
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('person', '0025_chat_and_polls_apikey'),
10+
]
11+
12+
operations = [
13+
migrations.RemoveField(
14+
model_name='historicalperson',
15+
name='consent',
16+
),
17+
migrations.RemoveField(
18+
model_name='person',
19+
name='consent',
20+
),
21+
]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright The IETF Trust 2022, All Rights Reserved
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('person', '0026_drop_consent'),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name='personevent',
15+
name='type',
16+
field=models.CharField(choices=[('apikey_login', 'API key login'), ('email_address_deactivated', 'Email address deactivated')], max_length=50),
17+
),
18+
]

ietf/person/migrations/0026_name_character_validator.py renamed to ietf/person/migrations/0028_name_character_validator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Generated by Django 2.2.28 on 2022-10-17 10:18
1+
# Copyright The IETF Trust 2022, All Rights Reserved
22

33
from django.db import migrations, models
44
import ietf.person.models
@@ -7,7 +7,7 @@
77
class Migration(migrations.Migration):
88

99
dependencies = [
10-
('person', '0025_chat_and_polls_apikey'),
10+
('person', '0027_personevent_drop_consent'),
1111
]
1212

1313
operations = [

ietf/person/models.py

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
from django.conf import settings
1515
from django.contrib.auth.models import User
16-
from django.core.exceptions import ObjectDoesNotExist, ValidationError
16+
from django.core.exceptions import ValidationError
1717
from django.core.validators import validate_email
1818
from django.db import models
1919
from django.template.loader import render_to_string
@@ -58,7 +58,6 @@ class Person(models.Model):
5858
photo = models.ImageField(storage=NoLocationMigrationFileSystemStorage(), upload_to=settings.PHOTOS_DIRNAME, blank=True, default=None)
5959
photo_thumb = models.ImageField(storage=NoLocationMigrationFileSystemStorage(), upload_to=settings.PHOTOS_DIRNAME, blank=True, default=None)
6060
name_from_draft = models.CharField("Full Name (from submission)", null=True, max_length=255, editable=False, help_text="Name as found in a draft submission.")
61-
consent = models.BooleanField("I hereby give my consent to the use of the personal details I have provided (photo, bio, name, pronouns, email) within the IETF Datatracker", null=True, default=None)
6261

6362
def __str__(self):
6463
return self.plain_name()
@@ -194,32 +193,6 @@ def expired_drafts(self):
194193
from ietf.doc.models import Document
195194
return Document.objects.filter(documentauthor__person=self, type='draft', states__slug__in=['repl', 'expired', 'auth-rm', 'ietf-rm']).distinct().order_by('-time')
196195

197-
def needs_consent(self):
198-
"""
199-
Returns an empty list or a list of fields which holds information that
200-
requires consent to be given.
201-
"""
202-
needs_consent = []
203-
if self.name != self.name_from_draft:
204-
needs_consent.append("full name")
205-
if self.ascii != self.name_from_draft:
206-
needs_consent.append("ascii name")
207-
if self.biography and not (self.role_set.exists() or self.rolehistory_set.exists()):
208-
needs_consent.append("biography")
209-
if self.user_id:
210-
needs_consent.append("login")
211-
try:
212-
if self.user.communitylist_set.exists():
213-
needs_consent.append("draft notification subscription(s)")
214-
except ObjectDoesNotExist:
215-
pass
216-
for email in self.email_set.all():
217-
if not email.origin.split(':')[0] in ['author', 'role', 'reviewer', 'liaison', 'shepherd', ]:
218-
needs_consent.append("email address(es)")
219-
break
220-
if self.pronouns_freetext or self.pronouns_selectable:
221-
needs_consent.append("pronouns")
222-
return needs_consent
223196

224197
def save(self, *args, **kwargs):
225198
created = not self.pk
@@ -428,7 +401,6 @@ def __str__(self):
428401

429402
PERSON_EVENT_CHOICES = [
430403
("apikey_login", "API key login"),
431-
("gdpr_notice_email", "GDPR consent request email sent"),
432404
("email_address_deactivated", "Email address deactivated"),
433405
]
434406

0 commit comments

Comments
 (0)