Skip to content

Commit 2efdb14

Browse files
committed
Don't update old cancelled r25 events
If the Mazevo booking we're updating isn't wanted in R25, and there's an existing cancelled R25 event with a matching number, just ignore it.
1 parent 4c38b04 commit 2efdb14

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

mazevo_r25/management/commands/mazevo2r25.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,13 @@ def handle(self, *args, **options):
336336
r25_res.space_reservation = None
337337
r25_event.reservations.append(r25_res)
338338

339+
if ( not wanted_booking and
340+
r25_event.state == r25_event.CANCELLED_STATE ):
341+
342+
# Don't bother updating it
343+
logger.debug("\tSkipping update of already cancelled event")
344+
continue
345+
339346
event_name = booking.event_name
340347
if isinstance(event_name, six.text_type):
341348
event_name = unicodedata.normalize("NFKD", event_name).encode(

0 commit comments

Comments
 (0)