Skip to content

Commit

Permalink
fix user id arg
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-clan committed Jul 23, 2024
1 parent 7cbb632 commit 37c3f08
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/app/admin/service/user_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ async def update_permission(*, request: Request, pk: int) -> int:
user_id = request.user.id
if pk == user_id:
raise errors.ForbiddenError(msg='禁止修改自身管理员权限')
super_status = await user_dao.get_super(db, request.user.id)
super_status = await user_dao.get_super(db, user_id)
count = await user_dao.set_super(db, pk, False if super_status else True)
return count

Expand All @@ -174,7 +174,7 @@ async def update_staff(*, request: Request, pk: int) -> int:
user_id = request.user.id
if pk == user_id:
raise errors.ForbiddenError(msg='禁止修改自身后台管理登陆权限')
staff_status = await user_dao.get_staff(db, request.user.id)
staff_status = await user_dao.get_staff(db, user_id)
count = await user_dao.set_staff(db, pk, False if staff_status else True)
return count

Expand Down

0 comments on commit 37c3f08

Please sign in to comment.