From d9d02a241bbf29c7bbd8306fd658af400680151b Mon Sep 17 00:00:00 2001 From: Luca Date: Fri, 29 Apr 2022 02:55:03 +0200 Subject: [PATCH] Don't show debug notification if not in debug mode --- shiftregister/app/views.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/shiftregister/app/views.py b/shiftregister/app/views.py index 0dbcdf8..186f72d 100644 --- a/shiftregister/app/views.py +++ b/shiftregister/app/views.py @@ -114,11 +114,12 @@ def register(request): messages.INFO, f"Du hast einen Login-Link an deine Telefonnummer erhalten. Falls du die SMS nicht erhalten hast, probiere es in 15 Minuten noch ein mal.", ) - messages.add_message( - request, - messages.INFO, - f"DEBUG:{token.get_absolute_url()}", - ) + if settings.DEBUG: + messages.add_message( + request, + messages.INFO, + f"DEBUG:{token.get_absolute_url()}", + ) if token.sent_at < ( timezone.now() - datetime.timedelta(minutes=math.pow(10, token.send_count))