From 02d9b38ef9fb55863ea27d6f82c26dac4e5f469c Mon Sep 17 00:00:00 2001 From: Felipe Martin Date: Thu, 3 Apr 2014 13:36:45 +0200 Subject: [PATCH] Allowing beta access for superusers even if they're not inside the beta group --- shelfzilla/middleware.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/shelfzilla/middleware.py b/shelfzilla/middleware.py index 5f244f0..9dda2e6 100644 --- a/shelfzilla/middleware.py +++ b/shelfzilla/middleware.py @@ -8,6 +8,7 @@ class BetaMiddleware(object): """ def process_request(self, request): beta_group_id = settings.BETA_ACCESS_GROUP_ID - if request.user and not request.user.groups.filter(pk=beta_group_id): - if request.path not in settings.BETA_ACCESS_ALLOW_URLS: - return HttpResponseRedirect('/landing/') + if request.user and not request.user.is_superuser: + if not request.user.groups.filter(pk=beta_group_id): + if request.path not in settings.BETA_ACCESS_ALLOW_URLS: + return HttpResponseRedirect('/landing/')