Merge pull request 'check condition' (#42) from feature/add-condition into master
Reviewed-on: #42
This commit is contained in:
commit
e5128a9182
@ -143,6 +143,7 @@ async def delete_users_id(item_id : str, authorize: Annotated[bool, Depends(perm
|
|||||||
async def update_users_me(current_user: Annotated[users.User, Depends(users_token.get_current_active_user)], authorize: Annotated[bool, Depends(permissions_checker.PermissionChecker(roles=["Admin", "User"]))], userSingle: users.UserIn | None = None):
|
async def update_users_me(current_user: Annotated[users.User, Depends(users_token.get_current_active_user)], authorize: Annotated[bool, Depends(permissions_checker.PermissionChecker(roles=["Admin", "User"]))], userSingle: users.UserIn | None = None):
|
||||||
user_repository = users.UserRepository(database=database.database)
|
user_repository = users.UserRepository(database=database.database)
|
||||||
current_user.username = userSingle.username
|
current_user.username = userSingle.username
|
||||||
|
if len(userSingle.password) > 0:
|
||||||
current_user.password = user_token.get_password_hash(userSingle.password)
|
current_user.password = user_token.get_password_hash(userSingle.password)
|
||||||
current_user.roles = userSingle.roles
|
current_user.roles = userSingle.roles
|
||||||
current_user.email = userSingle.email
|
current_user.email = userSingle.email
|
||||||
@ -202,6 +203,7 @@ async def update_users_id(item_id: str, authorize: Annotated[bool, Depends(permi
|
|||||||
)
|
)
|
||||||
|
|
||||||
user.username = userSingle.username
|
user.username = userSingle.username
|
||||||
|
if len(userSingle.password) > 0:
|
||||||
user.password = users_token.get_password_hash(userSingle.password)
|
user.password = users_token.get_password_hash(userSingle.password)
|
||||||
user.roles = userSingle.roles
|
user.roles = userSingle.roles
|
||||||
user.email = userSingle.email
|
user.email = userSingle.email
|
||||||
|
Loading…
x
Reference in New Issue
Block a user