about summary refs log tree commit diff
path: root/uploader/authorisation.py
diff options
context:
space:
mode:
Diffstat (limited to 'uploader/authorisation.py')
-rw-r--r--uploader/authorisation.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/uploader/authorisation.py b/uploader/authorisation.py
index ee8fe97..3cf3585 100644
--- a/uploader/authorisation.py
+++ b/uploader/authorisation.py
@@ -16,13 +16,12 @@ def require_login(function):
     @wraps(function)
     def __is_session_valid__(*args, **kwargs):
         """Check that the user is logged in and their token is valid."""
-        def __clear_session__(_no_token):
-            session.clear_session_info()
-            flash("You need to be logged in.", "alert-danger")
+        def __alert_needs_sign_in__(_no_token):
+            flash("You need to be signed in.", "alert alert-danger big-alert")
             return redirect("/")
 
         return session.user_token().either(
-            __clear_session__,
+            __alert_needs_sign_in__,
             lambda token: function(*args, **kwargs))
     return __is_session_valid__
 
@@ -49,7 +48,7 @@ def require_token(func: Callable) -> Callable:
     """
     def __invalid_token__(_whatever):
         logging.debug("==========> Failure log: %s", _whatever)
-        raise Exception(
+        raise Exception(# pylint: disable=[broad-exception-raised]
             "You attempted to access a feature of the system that requires "
             "authorisation. Unfortunately, we could not verify you have the "
             "appropriate authorisation to perform the action you requested. "