From e6dd74a3fab65355c0aa187ee31d5ee74a888649 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Fri, 3 Feb 2023 15:15:26 +0300 Subject: auth: tests: mock token acquisition. Fix minor bugs. --- gn3/auth/authorisation/checks.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'gn3/auth') 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__ -- cgit v1.2.3