Commit 189243ba authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Merge branch 'cherry-pick-2bfc0071' into 'release/1.12'

Hotfix issue with the member object in events service

See merge request !649
parents 1ebd5f8a a8b5d919
......@@ -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,15 +47,16 @@ def event_permissions(member, event):
def is_organiser(member, event):
if member.is_superuser or member.has_perm("events.override_organiser"):
return True
if event and member.has_perm('events.change_event'):
committees = 0
if event is not None:
committees = member.get_committees().filter(
pk=event.organiser.pk).count()
return committees != 0
if member and member.is_authenticated:
if member.is_superuser or member.has_perm("events.override_organiser"):
return True
if event and member.has_perm('events.change_event'):
committees = 0
if event is not None:
committees = member.get_committees().filter(
pk=event.organiser.pk).count()
return committees != 0
return False
......
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