From 6d61ef8de94fa87cb6ee31cc57f1f37dd04d097d Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 24 Apr 2024 11:34:09 +0300 Subject: Move the errors module up one level to break circular dependencies. --- gn_auth/auth/authorisation/resources/errors.py | 2 +- gn_auth/auth/authorisation/resources/groups/data.py | 2 +- gn_auth/auth/authorisation/resources/groups/models.py | 2 +- gn_auth/auth/authorisation/resources/groups/views.py | 2 +- gn_auth/auth/authorisation/resources/models.py | 2 +- gn_auth/auth/authorisation/resources/views.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'gn_auth/auth/authorisation/resources') diff --git a/gn_auth/auth/authorisation/resources/errors.py b/gn_auth/auth/authorisation/resources/errors.py index dc6c379..a13ea1f 100644 --- a/gn_auth/auth/authorisation/resources/errors.py +++ b/gn_auth/auth/authorisation/resources/errors.py @@ -1,6 +1,6 @@ """Exceptions for Authorisation""" -from gn_auth.auth.authorisation.errors import AuthorisationError +from gn_auth.auth.errors import AuthorisationError class MissingGroupError(AuthorisationError): """Raised for any resource operation without a group.""" diff --git a/gn_auth/auth/authorisation/resources/groups/data.py b/gn_auth/auth/authorisation/resources/groups/data.py index 9fcdc6e..702955d 100644 --- a/gn_auth/auth/authorisation/resources/groups/data.py +++ b/gn_auth/auth/authorisation/resources/groups/data.py @@ -4,8 +4,8 @@ from MySQLdb.cursors import DictCursor from gn_auth.auth.db import mariadb as gn3db from gn_auth.auth.db import sqlite3 as authdb +from gn_auth.auth.errors import NotFoundError from gn_auth.auth.authorisation.checks import authorised_p -from gn_auth.auth.authorisation.errors import NotFoundError from gn_auth.auth.authorisation.resources.groups import Group def __fetch_mrna_data_by_ids__( diff --git a/gn_auth/auth/authorisation/resources/groups/models.py b/gn_auth/auth/authorisation/resources/groups/models.py index e8c3492..3feefa6 100644 --- a/gn_auth/auth/authorisation/resources/groups/models.py +++ b/gn_auth/auth/authorisation/resources/groups/models.py @@ -15,7 +15,7 @@ from gn_auth.auth.authorisation.checks import authorised_p from gn_auth.auth.authorisation.privileges import Privilege from gn_auth.auth.authorisation.resources.base import Resource from gn_auth.auth.authorisation.resources.errors import MissingGroupError -from gn_auth.auth.authorisation.errors import ( +from gn_auth.auth.errors import ( NotFoundError, AuthorisationError, InconsistencyError) from gn_auth.auth.authorisation.roles.models import ( Role, create_role, check_user_editable, revoke_user_role_by_name, diff --git a/gn_auth/auth/authorisation/resources/groups/views.py b/gn_auth/auth/authorisation/resources/groups/views.py index 303368c..fe7a3de 100644 --- a/gn_auth/auth/authorisation/resources/groups/views.py +++ b/gn_auth/auth/authorisation/resources/groups/views.py @@ -19,7 +19,7 @@ from gn_auth.auth.authorisation.roles.models import user_roles from gn_auth.auth.authorisation.checks import authorised_p from gn_auth.auth.authorisation.privileges import Privilege, privileges_by_ids -from gn_auth.auth.authorisation.errors import InvalidData, NotFoundError, AuthorisationError +from gn_auth.auth.errors import InvalidData, NotFoundError, AuthorisationError from gn_auth.auth.authentication.users import User from gn_auth.auth.authentication.oauth2.resource_server import require_oauth diff --git a/gn_auth/auth/authorisation/resources/models.py b/gn_auth/auth/authorisation/resources/models.py index 9931559..e23aac5 100644 --- a/gn_auth/auth/authorisation/resources/models.py +++ b/gn_auth/auth/authorisation/resources/models.py @@ -11,7 +11,7 @@ from gn_auth.auth.db.sqlite3 import with_db_connection from gn_auth.auth.authorisation.roles import Role from gn_auth.auth.authorisation.privileges import Privilege from gn_auth.auth.authorisation.checks import authorised_p -from gn_auth.auth.authorisation.errors import NotFoundError, AuthorisationError +from gn_auth.auth.errors import NotFoundError, AuthorisationError from .checks import authorised_for from .base import Resource, ResourceCategory diff --git a/gn_auth/auth/authorisation/resources/views.py b/gn_auth/auth/authorisation/resources/views.py index e256b3e..58adaa2 100644 --- a/gn_auth/auth/authorisation/resources/views.py +++ b/gn_auth/auth/authorisation/resources/views.py @@ -14,7 +14,7 @@ from gn_auth.auth.db import sqlite3 as db from gn_auth.auth.db.sqlite3 import with_db_connection from gn_auth.auth.authorisation.roles import Role -from gn_auth.auth.authorisation.errors import InvalidData, InconsistencyError, AuthorisationError +from gn_auth.auth.errors import InvalidData, InconsistencyError, AuthorisationError from gn_auth.auth.authentication.oauth2.resource_server import require_oauth from gn_auth.auth.authentication.users import User, user_by_id, user_by_email -- cgit v1.2.3