From: Guillaume Pellerin Date: Mon, 22 Apr 2024 15:15:24 +0000 (+0200) Subject: add Conference absolute url X-Git-Tag: 2.10.0~17 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=399bbd845432f5ab1622a1f0d1e15f469f17fe89;p=teleforma.git add Conference absolute url --- diff --git a/teleforma/models/core.py b/teleforma/models/core.py index e8bb8298..3cf902e5 100644 --- a/teleforma/models/core.py +++ b/teleforma/models/core.py @@ -645,6 +645,15 @@ class Conference(models.Model): models.Index(fields=['course', 'course_type', 'period', 'streaming', '-date_begin' ]), ] + def get_absolute_url(self): + if self.streaming: + return reverse_lazy('teleforma-conference-detail', + kwargs={'pk': self.id, 'period_id': self.period.id}) + else: + media = self.media.all()[0] + return reverse_lazy('teleforma-media-detail', + kwargs={'pk': media.id, 'period_id': self.period.id}) + def notif_conference(sender, instance, *args, **kwargs): if not instance.notified_live: