fmartingr
/
shelfzilla
Archived
1
0
Fork 0

Allowing beta access for superusers even if they're not inside the beta group

This commit is contained in:
Felipe Martin 2014-04-03 13:36:45 +02:00
parent 662c57a3e4
commit 02d9b38ef9
1 changed files with 4 additions and 3 deletions

View File

@ -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/')