@ -115,6 +115,11 @@ class LiveLesson(BaseModel, DeactivatedMixin):
def __str__(self):
return self.title
def save(self, *args, **kwargs):
if not self.id and LiveLesson.objects.filter(date=self.date).exists():
self.date = (datetime.combine(self.date, now().time()) + timedelta(days=1)).date()
super().save(*args, **kwargs)
def stream_index(self):
return self.stream.split('/')[-1]