diff --git a/chrono/api/views.py b/chrono/api/views.py index 78b0ee23..0f7f32b5 100644 --- a/chrono/api/views.py +++ b/chrono/api/views.py @@ -1867,14 +1867,15 @@ class RecurringFillslots(APIView): Booking.objects.filter(primary_booking__in=bookings_to_cancel).update( cancellation_datetime=cancellation_datetime ) - cancelled_events = [ - get_short_event_detail( - request, - events_by_id[x.event_id], - multiple_agendas=True, - ) - for x in bookings_to_cancel - ] + if payload.get('include_booked_events_detail'): + cancelled_events = [ + get_short_event_detail( + request, + events_by_id[x.event_id], + multiple_agendas=True, + ) + for x in bookings_to_cancel + ] cancelled_count = bookings_to_cancel.update(cancellation_datetime=cancellation_datetime) # and delete outdated cancelled bookings Booking.objects.filter(