summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDusty Phillips <buchuki@gmail.com>2008-06-30 02:44:02 +0200
committerDusty Phillips <buchuki@gmail.com>2008-06-30 02:44:02 +0200
commit8e029e99b8a5f48edf0fd003ac2ddd321d446fe8 (patch)
tree0f55d4eca7e83c7d2b29e0da8c7757f0f4bbe5b7
parentb579f98acf85e8d749a471a98f7940b859cb366f (diff)
downloadarchweb-8e029e99b8a5f48edf0fd003ac2ddd321d446fe8.tar.gz
archweb-8e029e99b8a5f48edf0fd003ac2ddd321d446fe8.tar.xz
drop an unnecessary db hit
-rw-r--r--packages/views.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/views.py b/packages/views.py
index e9162c0..0fa781c 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: