From f5501349985019fa29c0907b1063d3245b7010e7 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Sun, 23 Jul 2023 22:36:19 +0800 Subject: [PATCH] Added debug mode for frontend to handle email activation link changes --- stude/config/settings.py | 3 ++- .../email_activation/email_activation.html | 26 +++++-------------- 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/stude/config/settings.py b/stude/config/settings.py index b6dfe66..a9c6921 100644 --- a/stude/config/settings.py +++ b/stude/config/settings.py @@ -29,6 +29,7 @@ SECRET_KEY = str(os.getenv('SECRET_KEY')) # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True +FRONTEND_DEBUG = True ALLOWED_HOSTS = ['*', '127.0.0.1', 'localhost', '10.0.10.32', '10.0.10.8'] @@ -216,7 +217,7 @@ MEDIA_ROOT = os.path.join(BASE_DIR, 'media') DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' DOMAIN = '' -if (DEBUG): +if (FRONTEND_DEBUG): DOMAIN = 'exp' else: DOMAIN = 'stude' diff --git a/stude/templates/email_activation/email_activation.html b/stude/templates/email_activation/email_activation.html index d628f3a..29491d1 100644 --- a/stude/templates/email_activation/email_activation.html +++ b/stude/templates/email_activation/email_activation.html @@ -1,26 +1,14 @@ {% load i18n %} - -{% block subject %} -{% blocktrans %}Account activation on {{ site_name }}{% endblocktrans %} -{% endblock subject %} - -{% block text_body %} -{% blocktrans %}You're receiving this email because you need to finish activation process on {{ site_name }}.{% endblocktrans %} - -{% trans "Please open the following link to activate your account in-app:" %} -{{ domain }}://{{ url|safe }} - -{% trans "Thanks you for using StudE!" %} - -{% blocktrans %}The {{ site_name }} team{% endblocktrans %} -{% endblock text_body %} - {% block html_body %}

{% blocktrans %}You're receiving this email because you need to finish activation process on {{ site_name }}.{% endblocktrans %}

-

{% trans "Please go to the following page to activate your account in-app:" %}

-

{{ domain }}://{{url}}

+

{% trans "Please click on the button below to activate your account in-app:" %}

+

+ + Activate Account + +

{% blocktrans %}Many thanks from the {{ site_name }} team{% endblocktrans %}

-{% endblock html_body %} \ No newline at end of file +{% endblock html_body %}