From: Yoan Le Clanche Date: Wed, 15 Feb 2023 09:15:52 +0000 (+0100) Subject: set 'streaming' false when conference is over : https://trackers.pilotsystems.net... X-Git-Tag: 2.9.0~73^2 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=c483410cf204b9b8dbdf7f8c356f895badd24a96;p=teleforma.git set 'streaming' false when conference is over : https://trackers.pilotsystems.net/prebarreau/0637 --- diff --git a/teleforma/management/commands/teleforma-publish-notify-conferences.py b/teleforma/management/commands/teleforma-publish-notify-conferences.py index 58f2f8a5..f2a457d1 100644 --- a/teleforma/management/commands/teleforma-publish-notify-conferences.py +++ b/teleforma/management/commands/teleforma-publish-notify-conferences.py @@ -70,8 +70,9 @@ class Command(BaseCommand): if not minute_high_range: minute_high_range = MINUTES_HIGH_RANGE - now_minus = datetime.datetime.now() - datetime.timedelta(minutes=minute_low_range) - now_plus = datetime.datetime.now() + datetime.timedelta(minutes=minute_high_range) + now = datetime.datetime.now() + now_minus = now - datetime.timedelta(minutes=minute_low_range) + now_plus = now + datetime.timedelta(minutes=minute_high_range) publications = list(Conference.objects.filter( period=period, @@ -95,7 +96,6 @@ class Command(BaseCommand): if type(publication) == ConferencePublication: conference = publication.conference else: - conference = publication medias = conference.media.all() @@ -138,5 +138,12 @@ class Command(BaseCommand): publication.notified = True publication.save() - + # streaming published end conference should have a streaming propery set to False + for conference in Conference.objects.filter( + period=period, + status=3, + streaming=True, + date_end__lt=now): + conference.streaming = False + conference.save()