diff --git a/TODO b/TODO index 110e3f7..f9a5579 100644 --- a/TODO +++ b/TODO @@ -2,10 +2,10 @@ known bugs: html problem in mails: 14" -> 14" -stellenbeschreibung -> stellenbezeichnung - evapp/settings auf die richtigen adressen setzen Accounts klären mail in production testen + +Bemerkung like "E - VA soon" auf die webseite diff --git a/eva/settings_development.py b/eva/settings_development.py index c2de6d1..10775f7 100644 --- a/eva/settings_development.py +++ b/eva/settings_development.py @@ -27,6 +27,9 @@ SECRET_KEY = 'g%+i6+gkwt3zz@+k-5x1dtstuw4)&qd$lxd^bt2oswy5e1#dul' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True +# send mails only to debug mode adress even if in production +MAILTEST = True + STATIC_ROOT = BASE_DIR / 'staticfiles' ALLOWED_HOSTS = ['*'] diff --git a/eva/settings_production.py b/eva/settings_production.py index 0e61c92..768460f 100644 --- a/eva/settings_production.py +++ b/eva/settings_production.py @@ -49,15 +49,15 @@ SECRET_KEY = get_secret('SECRET_KEY') # SECURITY WARNING: don't run with debug turned on in production! DEBUG = False +# send mails only to debug mode adress even if in production +MAILTEST = True + # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! # SECRET_KEY = 'g%+i6+gkwt3zz@+k-5x1dtstuw4)&qd$lxd^bt2oswy5e1#dul' -# SECURITY WARNING: don't run with debug turned on in production! -DEBUG = False - STATIC_ROOT = BASE_DIR / 'staticfiles' ALLOWED_HOSTS = ['*'] diff --git a/evapp/settings.py b/evapp/settings.py index ff4ac6a..514b771 100644 --- a/evapp/settings.py +++ b/evapp/settings.py @@ -1,7 +1,7 @@ # temporary setting while change and exit is not yet fully implemented ONLY_ONBOARDING = True -# sender mail adress +# sender mail adress also used for MAILTEST mode EVA_MAIL = 'benni.baermann@wikimedia.de' # these Fields should be included in every mail diff --git a/evapp/views.py b/evapp/views.py index e1ec93c..9d93e33 100644 --- a/evapp/views.py +++ b/evapp/views.py @@ -130,7 +130,15 @@ class EvaFormView(LoginRequiredMixin, CookieWizardView): try: mail_template = get_template(f'evapp/department_mail.txt') - send_mail( + if settings.MAILTEST: + send_mail( + 'EVA: Neuzugang', + mail_template.render(context), + EVA_MAIL, + [EVA_MAIL, self.instance.usermail], + fail_silently=False) + else: + send_mail( 'EVA: Neuzugang', mail_template.render(context), EVA_MAIL,