]> git.parisson.com Git - teleforma.git/commitdiff
add hash uuid to stations
authoryomguy <yomguy@parisson.com>
Thu, 12 Jul 2012 17:03:25 +0000 (19:03 +0200)
committeryomguy <yomguy@parisson.com>
Thu, 12 Jul 2012 17:03:25 +0000 (19:03 +0200)
example/settings.py
teleforma/views.py

index 65fdb03451e7ba6035f490244d809ba457dd86f8..306c939f6bfbc02e969e43b215eda58b9a981036 100644 (file)
@@ -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'
index 4b85fa3f8e631e5edc6d1a9fa7632b0654341538..e7fb3edb1c291ee180e3e66fcf29e916c56d1424 100755 (executable)
@@ -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()