From: Guillaume Pellerin Date: Mon, 8 Apr 2019 07:16:35 +0000 (+0200) Subject: Add Conference.streaming option X-Git-Tag: 0.9-tc~16 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=d7da1cc17f3d54a1a4b89115ea52ed2a064415af;p=teleforma.git Add Conference.streaming option --- 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)