Elrond correctly remarked that we should be comparing user by id
and not by comparing User objects (as I mistakenly did). He is
right, of course!
Also removing the 2 stray debug prints that were left over.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
#
# Make sure we have permission to access this user's panel. Only
# admins and this user herself should be able to do so.
- if not (user == request.user
- or request.user.is_admin):
+ if not (user.id == request.user.id or request.user.is_admin):
# No? Simply redirect to this user's homepage.
- print user
- print request.user
return redirect(
request, 'mediagoblin.user_pages.user_home',
user=user.username)