aboutsummaryrefslogtreecommitdiff
path: root/gn_auth/auth/authorisation/users/views.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-09-14 12:06:23 +0300
committerFrederick Muriuki Muriithi2023-09-26 03:44:30 +0300
commite19b01571ce61e01f482a1dadeeb2fd835fda939 (patch)
tree27b8c7f86313a86bc1e6705ac65ff5996403eace /gn_auth/auth/authorisation/users/views.py
parent345e33fc8e1b12dda6626307ebac7e1206200974 (diff)
downloadgn-auth-e19b01571ce61e01f482a1dadeeb2fd835fda939.tar.gz
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.
Diffstat (limited to 'gn_auth/auth/authorisation/users/views.py')
-rw-r--r--gn_auth/auth/authorisation/users/views.py30
1 files changed, 17 insertions, 13 deletions
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")