Commit 6ce9ffcf authored by Thom Wiggers's avatar Thom Wiggers 📐
Browse files

Merge branch 'fix/cancel-with-fine' into 'master'

Allow event cancellations when member has a fine

Closes #627

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