From d7da1cc17f3d54a1a4b89115ea52ed2a064415af Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Mon, 8 Apr 2019 09:16:35 +0200 Subject: [PATCH] Add Conference.streaming option --- teleforma/models/core.py | 2 +- teleforma/views/core.py | 24 ++++++++++++++---------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/teleforma/models/core.py b/teleforma/models/core.py index 4a403c9f..df3cbf9d 100644 --- a/teleforma/models/core.py +++ b/teleforma/models/core.py @@ -265,7 +265,7 @@ class Conference(Model): date_end = DateTimeField(_('end date'), null=True, blank=True) readers = ManyToManyField(User, related_name="conference", verbose_name=_('readers'), blank=True, null=True) - + streaming = models.BooleanField(_('streaming'), default=True) notes = generic.GenericRelation(Note) @property diff --git a/teleforma/views/core.py b/teleforma/views/core.py index e8df5dd4..227861f6 100644 --- a/teleforma/views/core.py +++ b/teleforma/views/core.py @@ -567,7 +567,11 @@ class ConferenceRecordView(FormView): status = Status() status.get_hosts() - stations = settings.TELECASTER_CONF + if conference.streaming: + stations = settings.TELECASTER_CONF + else: + stations = settings.TELECASTER_CONF_NO_STREAMING + for station in stations: type = station['type'] conf = station['conf'] @@ -589,16 +593,16 @@ class ConferenceRecordView(FormView): self.snapshot('http://localhost:8080/snapshot/monitor', station.output_dir) except: pass + if conference.streaming: + try: + live_message(self.conference) + except: + pass - try: - live_message(self.conference) - except: - pass - - try: - self.push() - except: - pass + try: + self.push() + except: + pass return super(ConferenceRecordView, self).form_valid(form) -- 2.39.5