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,7 +434,10 @@ 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)
return user_detail(request, user)
if user == request.user:
return my_profile(request)
else:
return user_detail(request, user)
@login_required()