summaryrefslogtreecommitdiffstats
path: root/expo/views_other.py
diff options
context:
space:
mode:
authorsubstantialnoninfringinguser <substantialnoninfringinguser@gmail.com>2009-05-24 23:24:59 +0100
committersubstantialnoninfringinguser <substantialnoninfringinguser@gmail.com>2009-05-24 23:24:59 +0100
commitb091e8eb09fe9c1f3949d5727acc79146e3cdf10 (patch)
tree98fa23a09befd6de1f7768e51a7422686cd0558d /expo/views_other.py
parent14b39d906c74bd491f2cb2ff13338efe7f190d8a (diff)
downloadtroggle-b091e8eb09fe9c1f3949d5727acc79146e3cdf10.tar.gz
troggle-b091e8eb09fe9c1f3949d5727acc79146e3cdf10.tar.bz2
troggle-b091e8eb09fe9c1f3949d5727acc79146e3cdf10.zip
[svn] Have control panel display an error for logged in, non-superuser users.
Diffstat (limited to 'expo/views_other.py')
-rw-r--r--expo/views_other.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/expo/views_other.py b/expo/views_other.py
index 504d1f6..f5944a6 100644
--- a/expo/views_other.py
+++ b/expo/views_other.py
@@ -65,7 +65,7 @@ def controlPanel(request):
if request.user.is_superuser:
#importlist is mostly here so that things happen in the correct order.
- #http post data seems to come in an unpredictable order, we do it this way.
+ #http post data seems to come in an unpredictable order, so we do it this way.
importlist=['reload_db', 'import_people', 'import_cavetab', 'import_logbooks', 'import_surveys', 'import_QMs']
databaseReset.make_dirs()
for item in importlist:
@@ -74,7 +74,10 @@ def controlPanel(request):
exec "databaseReset."+item+"()"
jobs_completed.append(item)
else:
- return HttpResponseRedirect(reverse('auth_login'))
+ if request.user.is_authenticated(): #The user is logged in, but is not a superuser.
+ return render_response(request,'controlPanel.html', {'caves':Cave.objects.all(),'error':'You must be a superuser to use that feature.'})
+ else:
+ return HttpResponseRedirect(reverse('auth_login'))
return render_response(request,'controlPanel.html', {'caves':Cave.objects.all(),'jobs_completed':jobs_completed})