Compare user by id not object equality

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>
This commit is contained in:
Sebastian Spaeth 2012-12-23 12:12:11 +01:00
parent 2fb36dac31
commit dfc23dd1e1

View File

@ -578,11 +578,8 @@ def processing_panel(request):
#
# 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)