fix: Allow users to perform actions on own profile

This commit is contained in:
moanos [he/him] 2024-11-20 20:00:27 +01:00
parent 7efa626b8b
commit 7a788f4c90

View File

@ -434,6 +434,9 @@ def user_by_id(request, user_id):
user = User.objects.get(id=user_id)
# Only users that are mods or owners of the user are allowed to view
fail_if_user_not_owner_or_trust_level(request.user, user)
if user == request.user:
return my_profile(request)
else:
return user_detail(request, user)