Verified Commit 2aef9874 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Fix issues with the member object in events services

parent 1ebd5f8a
......@@ -7,7 +7,7 @@ from events.models import Registration, RegistrationInformationField
def is_user_registered(event, member):
if not event.registration_required:
if not event.registration_required or not member.is_authenticated:
return None
return event.registrations.filter(
......@@ -21,7 +21,7 @@ def event_permissions(member, event):
"cancel_registration": False,
"update_registration": False,
if member.is_authenticated and member.can_attend_events:
if member and member.is_authenticated and member.can_attend_events:
registration = None
registration = Registration.objects.get(
......@@ -47,6 +47,7 @@ def event_permissions(member, event):
def is_organiser(member, event):
if member and member.is_authenticated:
if member.is_superuser or member.has_perm("events.override_organiser"):
return True
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment