From fdc92ec7f2eb74b0090b5adb9724ce60ce65829a Mon Sep 17 00:00:00 2001 From: Thomas Steen Rasmussen Date: Mon, 22 Jun 2020 01:09:45 +0200 Subject: [PATCH] take location into consideration when finding adjacent eventsessions --- src/utils/management/commands/convert_eventinstances.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils/management/commands/convert_eventinstances.py b/src/utils/management/commands/convert_eventinstances.py index 3e376449..3579fd01 100644 --- a/src/utils/management/commands/convert_eventinstances.py +++ b/src/utils/management/commands/convert_eventinstances.py @@ -49,14 +49,14 @@ class Command(BaseCommand): sa.when = (sa.when.lower, instance.when.upper) sa.save() logger.info( - f"extended speakeravailability {sa} to include instance {instance}" + f"extended speakeravailability {sa} for speaker {speaker} to include instance {instance}" ) except SpeakerAvailability.DoesNotExist: sa = SpeakerAvailability.objects.create( speaker=speaker, when=instance.when, available=True, ) logger.info( - f"created speakeravailability {sa} for instance {instance}" + f"created speakeravailability {sa} for speaker {speaker} for instance {instance}" ) except SpeakerAvailability.MultipleObjectsReturned: # who the hell does three events in a row?! @@ -93,6 +93,7 @@ class Command(BaseCommand): when__adjacent_to=instance.when, event_type_id=event_type_id, event_duration_minutes=duration, + event_location=instance.location, ) logger.info( f"found existing eventsession adjacent to instance {instance}"