]> git.openstreetmap.org Git - osqa.git/commitdiff
Fixes the is_staff decorator to allow superusers to.
authorhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Fri, 10 Jun 2011 22:31:23 +0000 (22:31 +0000)
committerhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Fri, 10 Jun 2011 22:31:23 +0000 (22:31 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1063 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/views/admin.py

index 696bf665689d3cfa05c37f76ef0aca16d34a5502..e9e9d476d27ea6bed6c184339be74eb7727d111a 100644 (file)
@@ -33,7 +33,7 @@ def super_user_required(fn):
 
 def staff_user_required(fn):
     def wrapper(request, *args, **kwargs):
-        if request.user.is_authenticated() and request.user.is_staff:
+        if request.user.is_authenticated() and (request.user.is_staff or request.user.is_superuser):
             return fn(request, *args, **kwargs)
         else:
             return HttpResponseUnauthorized(request)