Skip to content

Commit 97db5f7

Browse files
committed
Added a management command to send out gdpr consent requests.
- Legacy-Id: 15269
1 parent d8005ab commit 97db5f7

2 files changed

Lines changed: 61 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{% load ietf_filters %}{% filter wordwrap:78 %}
2+
Dear {{ person.plain_name }},
3+
4+
This email concerns some personal information stored in your IETF datatracker profile that
5+
requires your consent for storage and use.
6+
7+
If you do nothing in response to this email, the information in your profile that requires
8+
consent ({{ fields|safe }}) will be deleted one month from now, on {{ date }}.
9+
10+
If you would like to keep the information that requires consent available, please go to
11+
{{ settings.IDTRACKER_BASE_URL }}{% url 'ietf.ietfauth.views.profile' %}, check the
12+
information, scroll down to the end of the page, check the 'Consent' checkbox and submit
13+
the form.
14+
15+
For information on how personal information is handled in the datatracker, please see
16+
{{ settings.IDTRACKER_BASE_URL }}/help/personal-information.
17+
18+
Thank You,
19+
The IETF Secretariat
20+
{% endfilter %}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Copyright The IETF Trust 2016, All Rights Reserved
2+
# -*- coding: utf-8 -*-
3+
from __future__ import unicode_literals, print_function
4+
5+
import syslog
6+
import datetime
7+
8+
from django.conf import settings
9+
from django.core.management.base import BaseCommand
10+
11+
import debug # pyflakes:ignore
12+
13+
from ietf.person.models import Person
14+
from ietf.utils.mail import send_mail
15+
16+
def log(message):
17+
syslog.syslog(message)
18+
19+
class Command(BaseCommand):
20+
help = (u"Send GDPR consent requests to those that need it")
21+
22+
def add_arguments(self, parser):
23+
parser.add_argument('-n', '--dry-run', dest='dryrun', action='store_true', default=False,
24+
help="Don't send email, just list recipients")
25+
26+
def handle(self, *args, **options):
27+
for person in Person.objects.exclude(consent=True):
28+
fields = ', '.join(person.needs_consent())
29+
date = datetime.date.today() + datetime.timedelta(days=30)
30+
if fields and person.email_set.exists():
31+
if options['dryrun']:
32+
print(("%-32s %-32s %-32s %-32s %s" % (person.email(), person.name_from_draft or '', person.name, person.ascii, fields)).encode('utf8'))
33+
else:
34+
to = [ e.address for e in person.email_set.filter(active=True) ]
35+
if not to:
36+
to = [ e.address for e in person.email_set.all() ]
37+
send_mail(None, to, None,
38+
subject='Personal Information in the IETF Datatracker',
39+
template='utils/personal_information_notice.txt',
40+
context={'fields': fields, 'person': person, 'settings': settings, 'date': date, }, )
41+

0 commit comments

Comments
 (0)