fix(users): Fix import error inside `set_roles`
continuous-integration/woodpecker the build failed
Details
continuous-integration/woodpecker the build failed
Details
This commit is contained in:
parent
016ed7739a
commit
9bcba9c7f9
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue