Odvolani souhlasu o ochrane osobnich udaju: doplnen mail alert
This commit is contained in:
parent
a24f613b36
commit
6518d50577
|
@ -40,6 +40,7 @@ services:
|
|||
- NALODENI_AUTH_CLIENT_ID=s-pirati-nalodeni
|
||||
- NALODENI_AUTH_SERVER=s-https://auth.pirati.cz/auth/realms/pirati/
|
||||
- NALODENI_AUTH_CLIENT_SECRET=s-XXXXXXXXXXXXXXXXXXXX
|
||||
- NALODENI_EMAIL_RECIPIENT_GDPR=s-test@example.com
|
||||
volumes:
|
||||
nalodeni_static:
|
||||
|
||||
|
|
|
@ -48,6 +48,8 @@ ENV_APPROVED_UPDATES = {
|
|||
'EMAIL_SSL_CERTFILE' : ('EMAIL_SSL_CERTFILE',),
|
||||
'EMAIL_SSL_KEYFILE' : ('EMAIL_SSL_KEYFILE',),
|
||||
|
||||
'EMAIL_RECIPIENT_GDPR' : ('EMAIL_RECIPIENT_GDPR',),
|
||||
|
||||
'DEBUG' : ('DEBUG',),
|
||||
'DEBUG_LOCAL' : ('DEBUG_LOCAL',),
|
||||
}
|
||||
|
|
|
@ -91,10 +91,7 @@ TEMPLATES = [
|
|||
|
||||
WSGI_APPLICATION = 'main.wsgi.application'
|
||||
|
||||
|
||||
# Database
|
||||
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql',
|
||||
|
@ -157,24 +154,26 @@ USE_TZ = False
|
|||
STATIC_URL = '/static/'
|
||||
STATIC_ROOT = os.path.join(BASE_DIR,'static_files')
|
||||
|
||||
##
|
||||
# Locale, translation files
|
||||
##
|
||||
# Translations
|
||||
|
||||
LOCALE_PATHS = [
|
||||
BASE_DIR + "/locale",
|
||||
]
|
||||
|
||||
##
|
||||
# Email setup
|
||||
##
|
||||
|
||||
EMAIL_HOST="localhost"
|
||||
EMAIL_PORT=25
|
||||
#DEFAULT_FROM_EMAIL = 'nalodeni@pirati.cz'
|
||||
ANYMAIL = {
|
||||
"MAILGUN_API_KEY": "",
|
||||
"MAILGUN_SENDER_DOMAIN": '',
|
||||
"MAILGUN_API_URL": 'https://api.eu.mailgun.net/v3',
|
||||
}
|
||||
|
||||
# prijemce mailu s alertem "uzivatel odvolal souhlas se zpracovanim osobnich udaju"
|
||||
EMAIL_RECIPIENT_GDPR = 'gdpr@pirati.cz'
|
||||
#DEFAULT_FROM_EMAIL = 'nalodeni@pirati.cz'
|
||||
|
||||
#EMAIL_BACKEND = "anymail.backends.mailgun.EmailBackend"
|
||||
|
||||
##
|
||||
|
@ -195,15 +194,7 @@ AUTH_AVAIL_IDP = []
|
|||
#LOGIN_REDIRECT_URL = '/sso/login'
|
||||
#LOGOUT_REDIRECT_URL = '/sso/logout'
|
||||
|
||||
##
|
||||
# Email registration
|
||||
##
|
||||
# Email registration
|
||||
APP_REG_LIMIT_HARD = 50
|
||||
APP_REG_LIMIT_SOFT = 0
|
||||
TOKEN_VALID_SEC = 60*60*24*3
|
||||
|
||||
|
||||
|
||||
##
|
||||
# Defaults for settings_local variables
|
||||
##
|
||||
|
|
|
@ -29,8 +29,9 @@ from django.db.models import F
|
|||
|
||||
from django.core.validators import validate_email
|
||||
from django.core.exceptions import ValidationError
|
||||
|
||||
from django.core.mail import send_mail
|
||||
from django.core.cache import cache
|
||||
|
||||
import logging
|
||||
|
||||
from django.conf import settings as appSettings
|
||||
|
@ -378,7 +379,7 @@ def prihlaseni(request):
|
|||
|
||||
|
||||
"""
|
||||
|
||||
|
||||
if not request.user.is_anonymous:
|
||||
return HttpResponseRedirect('/ja-pirat/')
|
||||
|
||||
|
@ -505,6 +506,12 @@ def profil(request):
|
|||
if request.GET.get('undoConsent', None) is not None:
|
||||
request.user.dc_stamp = None
|
||||
request.user.dc_undo_stamp = datetime.now()
|
||||
messages.info(request, "Odvolal/a jste souhlas se zpracováním osobních údajů.")
|
||||
send_mail(
|
||||
"Nalodeni: %s odvolal souhlas se zpracovanim osobnich udaju" % request.user.email,
|
||||
"Stalo se tak {approxdate}".format(approxdate=datetime.now()),
|
||||
"nalodeni@pirati.cz", [appSettings.EMAIL_RECIPIENT_GDPR],
|
||||
)
|
||||
return save_and_redirect('/ja-pirat/profil/')
|
||||
|
||||
emailToken = request.GET.get('t', None)
|
||||
|
|
Loading…
Reference in New Issue