From 7a788f4c901951bf1a8b77db1ed60299bf049eb7 Mon Sep 17 00:00:00 2001 From: moanos Date: Wed, 20 Nov 2024 20:00:27 +0100 Subject: [PATCH] fix: Allow users to perform actions on own profile --- src/fellchensammlung/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/fellchensammlung/views.py b/src/fellchensammlung/views.py index bcb5893..6bb09d2 100644 --- a/src/fellchensammlung/views.py +++ b/src/fellchensammlung/views.py @@ -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()