import string
import random
import requests
+import asyncio
from teleforma.utils import guess_mimetypes
import django.db.models as models
str(date)]
return ' - '.join(list)
- def save(self, *args, **kwargs):
- if not self.public_id:
- self.public_id = get_random_hash()
- self.course.save()
-
+ async def notify(self):
if self.streaming and not self.notified_live:
# Notify live conferences by sending a signal to websocket.
# This signal will be catched by the channel instance to notify students
data={'id': self.id}, timeout=20.0)
# assert response.status_code == 200
self.notified_live = True
-
+
+ def save(self, *args, **kwargs):
+ if not self.public_id:
+ self.public_id = get_random_hash()
+ self.course.save()
+ self.notify()
super(Conference, self).save(*args, **kwargs)
def to_dict(self):