From e19b01571ce61e01f482a1dadeeb2fd835fda939 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 14 Sep 2023 12:06:23 +0300 Subject: Move `groups` package under `resources` package With user groups being resources that users can act on (with the recent changes), this commit moves the `groups` module to under the `resources` module. It also renames the `*_resources.py` modules by dropping the `_resources` part since the code is under the `resources` module anyway. --- gn_auth/auth/authorisation/users/views.py | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'gn_auth/auth/authorisation/users/views.py') diff --git a/gn_auth/auth/authorisation/users/views.py b/gn_auth/auth/authorisation/users/views.py index 6de30da..50386ac 100644 --- a/gn_auth/auth/authorisation/users/views.py +++ b/gn_auth/auth/authorisation/users/views.py @@ -7,24 +7,28 @@ import sqlite3 from email_validator import validate_email, EmailNotValidError from flask import request, jsonify, Response, Blueprint, current_app -from ...db import sqlite3 as db -from ...dictify import dictify -from ...db.sqlite3 import with_db_connection +from gn_auth.auth.db import sqlite3 as db +from gn_auth.auth.dictify import dictify +from gn_auth.auth.db.sqlite3 import with_db_connection + +from gn_auth.auth.authorisation.resources.models import ( + user_resources as _user_resources) +from gn_auth.auth.authorisation.roles.models import ( + assign_default_roles, user_roles as _user_roles) +from gn_auth.auth.authorisation.errors import ( + NotFoundError, UsernameError, PasswordError, UserRegistrationError) +from gn_auth.auth.authorisation.resources.groups.models import ( + user_group as _user_group) + +from gn_auth.auth.authentication.oauth2.resource_server import require_oauth +from gn_auth.auth.authentication.users import User, save_user, set_user_password +from gn_auth.auth.authentication.oauth2.models.oauth2token import ( + token_by_access_token) from .models import list_users from .masquerade.views import masq from .collections.views import collections -from ..groups.models import user_group as _user_group -from ..resources.models import user_resources as _user_resources -from ..roles.models import assign_default_roles, user_roles as _user_roles -from ..errors import ( - NotFoundError, UsernameError, PasswordError, UserRegistrationError) - -from ...authentication.oauth2.resource_server import require_oauth -from ...authentication.users import User, save_user, set_user_password -from ...authentication.oauth2.models.oauth2token import token_by_access_token - users = Blueprint("users", __name__) users.register_blueprint(masq, url_prefix="/masquerade") users.register_blueprint(collections, url_prefix="/collections") -- cgit v1.2.3