From: Sebastian Spaeth Date: Sun, 23 Dec 2012 11:12:11 +0000 (+0100) Subject: Compare user by id not object equality X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=dfc23dd1e16618cdbac0a22261573be3e5d29852;p=mediagoblin.git 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 --- diff --git a/mediagoblin/user_pages/views.py b/mediagoblin/user_pages/views.py index 79345a4e..33828c1b 100644 --- a/mediagoblin/user_pages/views.py +++ b/mediagoblin/user_pages/views.py @@ -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)