From f9cea9330bc1d75657b69eaa314325bb871616fa Mon Sep 17 00:00:00 2001
From: David Schmitz <schmitz@lrz.de>
Date: Tue, 4 Jul 2023 06:14:18 +0000
Subject: [PATCH] fix/false_user_activation_error: stop forcing error message

---
 accounts/views.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/accounts/views.py b/accounts/views.py
index a0fc05a2..dc12ec53 100644
--- a/accounts/views.py
+++ b/accounts/views.py
@@ -130,6 +130,7 @@ def activate(request, activation_key):
                 }
             )
 
+        error = None
         if account:
             # A user has been activated
             email = render_to_string(
@@ -139,7 +140,6 @@ def activate(request, activation_key):
                     'user': account
                 }
             )
-            error = None
             try:
                 send_mail(
                     _("%sUser account activated") % settings.EMAIL_SUBJECT_PREFIX,
@@ -149,7 +149,8 @@ def activate(request, activation_key):
                 )
             except SMTPRecipientsRefused as e:
                 logger.error("Failed to send a notification e-mail to the user: %s" % e)
-                error = e
+                #error = e
+                error = "Failed to send a notification e-mail to the user"
                 
         logger.info('Activated account %s' % account)
         return render(
@@ -158,6 +159,6 @@ def activate(request, activation_key):
             {
                 'account': account,
                 'expiration_days': settings.ACCOUNT_ACTIVATION_DAYS,
-                'error': "Failed to send a notification e-mail to the user"
+                'error': error
             },
         )
-- 
GitLab