summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorDusty Phillips <buchuki@gmail.com>2008-06-29 20:44:02 -0400
committerDusty Phillips <buchuki@gmail.com>2008-06-29 20:44:02 -0400
commit8e029e99b8a5f48edf0fd003ac2ddd321d446fe8 (patch)
tree0f55d4eca7e83c7d2b29e0da8c7757f0f4bbe5b7 /packages
parentb579f98acf85e8d749a471a98f7940b859cb366f (diff)
drop an unnecessary db hit
Diffstat (limited to 'packages')
-rw-r--r--packages/views.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/views.py b/packages/views.py
index e9162c0f..0fa781c4 100644
--- a/packages/views.py
+++ b/packages/views.py
@@ -18,9 +18,10 @@ def update(request):
if request.POST.has_key('disown'):
mode = 'disown'
message = 'Disown was successful'
- try:
- maint = User.objects.get(username=request.user.username)
- except User.DoesNotExist:
+
+ if request.user.is_authenticated():
+ maint = request.user
+ else:
return render_response(request, 'error_page.html', {'errmsg':'No maintainer record found! Are you a maintainer?'})
ids = request.POST.getlist('pkgid')
for id in ids: