api: don't build details if not requested (#77590)
gitea/chrono/pipeline/head Build queued... Details

This commit is contained in:
Lauréline Guérin 2023-05-24 14:43:00 +02:00
parent 16851755e6
commit 2d17cbc1b3
No known key found for this signature in database
GPG Key ID: 1FAB9B9B4F93D473
1 changed files with 9 additions and 8 deletions

View File

@ -1853,14 +1853,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(