From 20a8f29cd675e95bf8b74a43123bcea2b4f354f0 Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Fri, 25 Aug 2023 15:58:59 -0500 Subject: [PATCH] Send html for email change --- judge/views/email.py | 8 +++++++- locale/vi/LC_MESSAGES/django.po | 4 +--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/judge/views/email.py b/judge/views/email.py index c37f857..922b74f 100644 --- a/judge/views/email.py +++ b/judge/views/email.py @@ -52,7 +52,13 @@ def email_change_view(request): ), } message = render_email_message(request, email_contexts) - send_mail(subject, message, settings.EMAIL_HOST_USER, [new_email]) + send_mail( + subject, + message, + settings.EMAIL_HOST_USER, + [new_email], + html_message=message, + ) profile.email_change_pending = new_email profile.save() return redirect("email_change_pending") diff --git a/locale/vi/LC_MESSAGES/django.po b/locale/vi/LC_MESSAGES/django.po index e182034..d1e8a78 100644 --- a/locale/vi/LC_MESSAGES/django.po +++ b/locale/vi/LC_MESSAGES/django.po @@ -2860,10 +2860,8 @@ msgid "New Email" msgstr "Email mới" #: judge/views/email.py:25 -#, fuzzy -#| msgid "Contest with key already exists." msgid "An account with this email already exists." -msgstr "Mã kỳ thi đã tồn tại." +msgstr "Email đã được dùng cho tài khoản khác." #: judge/views/email.py:43 msgid "Email Change Request"