Allow all staff users (= admin login users) to purge things from varnish

Previously we required superuser, but that seems a bit excessive. We could
limit it based on specific groups, but for now, we'll allow all staff users.
This commit is contained in:
Magnus Hagander
2012-03-06 10:51:48 +01:00
parent 20257960ec
commit 3442fdde57

View File

@ -176,7 +176,7 @@ def admin_pending(request):
# Purge objects from varnish, for the admin pages
@login_required
@user_passes_test(lambda u: u.is_superuser)
@user_passes_test(lambda u: u.is_staff)
def admin_purge(request):
if request.method == 'POST':
url = request.POST['url']