Commit 2bfc0071 authored by Thom Wiggers's avatar Thom Wiggers 📐
Browse files

Merge branch 'fix/events-services-member-object' into 'master'

Fix issues with the member object in events services

See merge request !648
parents 6899a906 2aef9874
......@@ -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
try:
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