fix(users): Fix import error inside `set_roles`
continuous-integration/woodpecker the build failed Details

This commit is contained in:
Ferdinand Thiessen 2021-12-22 00:37:52 +01:00
parent 016ed7739a
commit 9bcba9c7f9
1 changed files with 2 additions and 2 deletions

View File

@ -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