Added a management command to send out gdpr consent requests.
- Legacy-Id: 15269
This commit is contained in:
parent
d8005ab0f1
commit
97db5f71b5
20
ietf/templates/utils/personal_information_notice.txt
Normal file
20
ietf/templates/utils/personal_information_notice.txt
Normal file
|
@ -0,0 +1,20 @@
|
|||
{% load ietf_filters %}{% filter wordwrap:78 %}
|
||||
Dear {{ person.plain_name }},
|
||||
|
||||
This email concerns some personal information stored in your IETF datatracker profile that
|
||||
requires your consent for storage and use.
|
||||
|
||||
If you do nothing in response to this email, the information in your profile that requires
|
||||
consent ({{ fields|safe }}) will be deleted one month from now, on {{ date }}.
|
||||
|
||||
If you would like to keep the information that requires consent available, please go to
|
||||
{{ settings.IDTRACKER_BASE_URL }}{% url 'ietf.ietfauth.views.profile' %}, check the
|
||||
information, scroll down to the end of the page, check the 'Consent' checkbox and submit
|
||||
the form.
|
||||
|
||||
For information on how personal information is handled in the datatracker, please see
|
||||
{{ settings.IDTRACKER_BASE_URL }}/help/personal-information.
|
||||
|
||||
Thank You,
|
||||
The IETF Secretariat
|
||||
{% endfilter %}
|
41
ietf/utils/management/commands/send_gdpr_consent_request.py
Normal file
41
ietf/utils/management/commands/send_gdpr_consent_request.py
Normal file
|
@ -0,0 +1,41 @@
|
|||
# Copyright The IETF Trust 2016, All Rights Reserved
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals, print_function
|
||||
|
||||
import syslog
|
||||
import datetime
|
||||
|
||||
from django.conf import settings
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
import debug # pyflakes:ignore
|
||||
|
||||
from ietf.person.models import Person
|
||||
from ietf.utils.mail import send_mail
|
||||
|
||||
def log(message):
|
||||
syslog.syslog(message)
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = (u"Send GDPR consent requests to those that need it")
|
||||
|
||||
def add_arguments(self, parser):
|
||||
parser.add_argument('-n', '--dry-run', dest='dryrun', action='store_true', default=False,
|
||||
help="Don't send email, just list recipients")
|
||||
|
||||
def handle(self, *args, **options):
|
||||
for person in Person.objects.exclude(consent=True):
|
||||
fields = ', '.join(person.needs_consent())
|
||||
date = datetime.date.today() + datetime.timedelta(days=30)
|
||||
if fields and person.email_set.exists():
|
||||
if options['dryrun']:
|
||||
print(("%-32s %-32s %-32s %-32s %s" % (person.email(), person.name_from_draft or '', person.name, person.ascii, fields)).encode('utf8'))
|
||||
else:
|
||||
to = [ e.address for e in person.email_set.filter(active=True) ]
|
||||
if not to:
|
||||
to = [ e.address for e in person.email_set.all() ]
|
||||
send_mail(None, to, None,
|
||||
subject='Personal Information in the IETF Datatracker',
|
||||
template='utils/personal_information_notice.txt',
|
||||
context={'fields': fields, 'person': person, 'settings': settings, 'date': date, }, )
|
||||
|
Loading…
Reference in a new issue