From fc5d2456d05cdad659185cc59d1306d1bc902485 Mon Sep 17 00:00:00 2001 From: yomguy Date: Thu, 12 Jul 2012 19:03:25 +0200 Subject: [PATCH] add hash uuid to stations --- example/settings.py | 2 +- teleforma/views.py | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/example/settings.py b/example/settings.py index 65fdb034..306c939f 100644 --- a/example/settings.py +++ b/example/settings.py @@ -187,4 +187,4 @@ POSTMAN_AUTO_MODERATE_AS = True #FILE_PROTECTION_METHOD = 'xsendfile' -TELECASTER_CONF = '/etc/telecaster/telecaster.xml' +TELECASTER_CONF = '/etc/telecaster/deefuzzer_mp3.xml' diff --git a/teleforma/views.py b/teleforma/views.py index 4b85fa3f..e7fb3edb 100755 --- a/teleforma/views.py +++ b/teleforma/views.py @@ -2,6 +2,7 @@ import mimetypes import datetime +import random from jsonrpc import jsonrpc_method @@ -161,6 +162,11 @@ def get_host(request): return host +def get_random_hash(): + hash = random.getrandbits(128) + return "%032x" % hash + + class CourseView(DetailView): model = Course @@ -339,10 +345,10 @@ class ConferenceView(DetailView): for stream in conference.livestream.all(): stream.delete() for station in conference.station.all(): + station.started = False + station.save() station.stop() - station.delete() - @method_decorator(login_required) def dispatch(self, *args, **kwargs): return super(ConferenceView, self).dispatch(*args, **kwargs) @@ -367,10 +373,12 @@ class ConferenceRecordView(FormView): def form_valid(self, form): form.save() + uuid = get_random_hash() self.conference = form.instance self.conference.date_begin = datetime.datetime.now() + self.conference.public_id = uuid self.conference.save() - station = Station(conference=self.conference) + station = Station(conference=self.conference, public_id=uuid) station.setup(settings.TELECASTER_CONF) station.start() station.save() -- 2.39.5