fix(routers.accounts): use User.can_edit_user across the board

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2021-12-27 00:35:20 -08:00
parent 260b67c49e
commit 80ee7f3d4b
No known key found for this signature in database
GPG key ID: F7E46DED420788F3
2 changed files with 2 additions and 2 deletions

View file

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

View file

@ -86,7 +86,7 @@
| safe
}}
</li>
{% if request.user.has_credential(creds.ACCOUNT_EDIT, approved=[user]) %}
{% if request.user.can_edit_user(user) %}
<li>
{{ "%sEdit this user's account%s"
| tr