mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix(routers.accounts): use User.can_edit_user across the board
Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
260b67c49e
commit
80ee7f3d4b
2 changed files with 2 additions and 2 deletions
|
@ -341,7 +341,7 @@ def cannot_edit(request: Request, user: models.User) \
|
|||
:param user: Target user to be edited
|
||||
:return: RedirectResponse if approval != granted else None
|
||||
"""
|
||||
approved = request.user.has_credential(creds.ACCOUNT_EDIT, approved=[user])
|
||||
approved = request.user.can_edit_user(user)
|
||||
if not approved and (to := "/"):
|
||||
if user:
|
||||
to = f"/account/{user.Username}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue