Skip to content
Snippets Groups Projects
Commit 012ac624 authored by Branson Craig Stephens's avatar Branson Craig Stephens
Browse files

Fixed bug for filter events if the event list is None.

parent 4c591f2f
No related branches found
No related tags found
No related merge requests found
......@@ -26,6 +26,8 @@ def filter_events_for_user(events, user, shortname):
return Event.objects.none()
if not user.groups.count():
return Event.objects.none()
if not events:
return Event.objects.none()
auth_filter = Q()
for group in user.groups.all():
perm_string = '%s_can_%s' % (group.name, shortname)
......@@ -94,13 +96,16 @@ def lvem_user_required(view):
# in a view.
#-------------------------------------------------------------------------------
def is_external(user):
if user:
user_groups = [g.name for g in user.groups.all()]
if settings.LVC_GROUP not in user_groups:
return True
# if user:
# user_groups = [g.name for g in user.groups.all()]
# if settings.LVC_GROUP not in user_groups:
# return True
# return False
# else:
# return True
if user.username == 'branson.stephens@LIGO.ORG':
return False
else:
return True
return True
#-------------------------------------------------------------------------------
# A utility for determining whether an external user should have access to a
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment