Skip to content

Commit

Permalink
Ignore booking cancelations when deleting past events
Browse files Browse the repository at this point in the history
  • Loading branch information
micsucmed committed Nov 22, 2023
1 parent 341c197 commit 802ff15
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion indico/modules/rb/__init__.py
Expand Up @@ -5,6 +5,8 @@
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.

from datetime import datetime

from flask import session

from indico.core import signals
Expand Down Expand Up @@ -105,7 +107,8 @@ def _event_deleted(event, user, **kwargs):
.filter(~Reservation.is_rejected, ~Reservation.is_cancelled)
.all())
for link in reservation_links:
link.reservation.cancel(user or session.user, 'Associated event was deleted')
if link.reservation.end_dt >= datetime.now():
link.reservation.cancel(user or session.user, 'Associated event was deleted')


class BookPermission(ManagementPermission):
Expand Down

0 comments on commit 802ff15

Please sign in to comment.