aboutsummaryrefslogtreecommitdiff
path: root/gn3/auth/authorisation
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-02-03 15:15:26 +0300
committerFrederick Muriuki Muriithi2023-02-03 15:15:26 +0300
commite6dd74a3fab65355c0aa187ee31d5ee74a888649 (patch)
tree615214631357f96874b59919da4409d1b28cfe2b /gn3/auth/authorisation
parentecce454ca9d0f374e22da8401206e3b1695dbded (diff)
downloadgenenetwork3-e6dd74a3fab65355c0aa187ee31d5ee74a888649.tar.gz
auth: tests: mock token acquisition. Fix minor bugs.
Diffstat (limited to 'gn3/auth/authorisation')
-rw-r--r--gn3/auth/authorisation/checks.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/gn3/auth/authorisation/checks.py b/gn3/auth/authorisation/checks.py
index 6579afc..36ab5fa 100644
--- a/gn3/auth/authorisation/checks.py
+++ b/gn3/auth/authorisation/checks.py
@@ -1,15 +1,14 @@
"""Functions to check for authorisation."""
from functools import wraps
-from typing import Callable, Optional
+from typing import Callable
-from flask import g, current_app as app
+from flask import current_app as app
from gn3.auth import db
from . import privileges as auth_privs
from .errors import AuthorisationError
-from ..authentication.users import User
from ..authentication.oauth2.resource_server import require_oauth
def authorised_p(
@@ -36,6 +35,6 @@ def authorised_p(
if len(not_assigned) == 0:
return func(*args, **kwargs)
- raise AuthorisationError(error_message)
+ raise AuthorisationError(error_description)
return __authoriser__
return __build_authoriser__