From 9bcba9c7f9eae70813bd8255904ba5fccaf1318d Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Wed, 22 Dec 2021 00:37:52 +0100 Subject: [PATCH] fix(users): Fix import error inside `set_roles` --- flaschengeist/controller/userController.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flaschengeist/controller/userController.py b/flaschengeist/controller/userController.py index 2ab781a..bd6e4b8 100644 --- a/flaschengeist/controller/userController.py +++ b/flaschengeist/controller/userController.py @@ -101,7 +101,7 @@ def set_roles(user: User, roles: list[str], create=False): Raises: BadRequest if invalid arguments given or not all roles found while *create* is set to false """ - from roleController import create_role + from .roleController import create_role if not isinstance(roles, list) and any([not isinstance(r, str) for r in roles]): raise BadRequest("Invalid role name") @@ -149,7 +149,7 @@ def get_user_by_role(role: Role): return User.query.join(User.roles_).filter_by(role_id=role.id).all() -def get_user(uid, deleted=False): +def get_user(uid, deleted=False) -> User: """Get an user by userid from database Args: uid: Userid to search for