summaryrefslogtreecommitdiff
path: root/devel/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'devel/views.py')
-rw-r--r--devel/views.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/devel/views.py b/devel/views.py
index 4d0a0cc2..7e5f79ae 100644
--- a/devel/views.py
+++ b/devel/views.py
@@ -1,6 +1,6 @@
from django import forms
from django.http import HttpResponseRedirect
-from django.contrib.auth.decorators import login_required
+from django.contrib.auth.decorators import login_required, user_passes_test
from django.contrib.auth.models import User
from django.shortcuts import render_to_response
from django.template import RequestContext
@@ -105,10 +105,8 @@ Password: %s""" % (user.username, pw),
[user.email],
fail_silently=False)
+@user_passes_test(lambda u: u.is_superuser)
def new_user_form(request):
- if not request.user.is_superuser:
- return HttpResponseRedirect('/login/')
-
if request.POST:
form = NewUserForm(request.POST)
if form.is_valid():