Commit 2fbd7ffa authored by Tanner Prestegard's avatar Tanner Prestegard Committed by GraceDB

reorganizing repository following the two scoops philosophy

parent a8dde93a
*.swp
*~
*.pyc
apps/static/admin/
apps/static/rest_framework/
apps/static/debug_toolbar/
apps/static/django_extensions/
apps/static/guardian/
config/settings/secret.py
config/settings/local.py
docs/user_docs/build/*
docs/admin_docs/build/*
static-collected
static/admin/
static/rest_framework/
static/debug_toolbar/
static/django_extensions/
static/guardian/
......@@ -10,6 +10,6 @@ class AcceptMiddleware(MiddlewareMixin):
acc = [a.split(';')[0] for a in request.META['HTTP_ACCEPT'].split(',')]
except:
acc = ['text/html']
setattr(request, 'accepted_types', acc )
setattr(request, 'accepted_types', acc)
request.accepts = lambda type: type in acc
return None
from django.contrib.auth.models import Group
def LigoAuthContext(request):
#return { 'ligouser' : request.ligouser, 'user' : request.user }
internal_groups = Group.objects.filter(name__in=['Communities:LSCVirgoLIGOGroupMembers', 'executives'])
user_is_internal = False
if request.user:
if set(list(internal_groups)) & set(list(request.user.groups.all())):
user_is_internal = True
return { 'user' : request.user, 'user_is_internal' : user_is_internal }
return { 'ligouser' : request.user, 'user' : request.user }