Commit 7ad56b86 authored by Tom van Bussel's avatar Tom van Bussel
Browse files

Allow event cancellations when member has a fine

parent 39f389ff
...@@ -23,7 +23,7 @@ def event_permissions(member, event): ...@@ -23,7 +23,7 @@ def event_permissions(member, event):
"cancel_registration": False, "cancel_registration": False,
"update_registration": False, "update_registration": False,
} }
if member and member.is_authenticated and member.can_attend_events: if member and member.is_authenticated:
registration = None registration = None
try: try:
registration = Registration.objects.get( registration = Registration.objects.get(
...@@ -35,15 +35,18 @@ def event_permissions(member, event): ...@@ -35,15 +35,18 @@ def event_permissions(member, event):
perms["create_registration"] = ( perms["create_registration"] = (
(registration is None or registration.date_cancelled is not None) (registration is None or registration.date_cancelled is not None)
and event.registration_allowed) and event.registration_allowed and
member.can_attend_events)
perms["cancel_registration"] = ( perms["cancel_registration"] = (
registration is not None and registration is not None and
registration.date_cancelled is None and registration.date_cancelled is None and
event.cancellation_allowed) event.cancellation_allowed)
perms["update_registration"] = ( perms["update_registration"] = (
registration is not None and registration is not None and
registration.date_cancelled is None and event.has_fields() and registration.date_cancelled is None and
event.registration_allowed) event.has_fields() and
event.registration_allowed and
member.can_attend_events)
return perms return perms
......
Supports Markdown
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