diff --git a/apps/school/models.py b/apps/school/models.py index 4ba85193..38889f44 100644 --- a/apps/school/models.py +++ b/apps/school/models.py @@ -147,7 +147,7 @@ class LiveLesson(BaseModel, DeactivatedMixin): return self.get_absolute_url() def get_absolute_url(self): - return reverse_lazy('school:lesson-detail', args=[self.date.strftime('%d-%m-%y')]) + return reverse_lazy('school:lesson-detail', kwargs={'lesson_date': self.date.strftime('%d-%m-%y')}) def stream_index(self): return self.stream.split('/')[-1] diff --git a/apps/school/templates/school/livelessons_list.html b/apps/school/templates/school/livelessons_list.html index 2f435dcc..161a6629 100644 --- a/apps/school/templates/school/livelessons_list.html +++ b/apps/school/templates/school/livelessons_list.html @@ -11,7 +11,7 @@ {% for livelesson in livelesson_list %}
- + diff --git a/apps/school/urls.py b/apps/school/urls.py index c36664f0..9ac1d078 100644 --- a/apps/school/urls.py +++ b/apps/school/urls.py @@ -1,4 +1,4 @@ -from django.urls import path, include +from django.urls import path, re_path from .views import ( LiveLessonsView, LiveLessonEditView, @@ -12,6 +12,6 @@ urlpatterns = [ path('lessons/', LiveLessonsView.as_view(), name='lessons'), path('lessons/create', LiveLessonEditView.as_view(), name='lessons-create'), path('lessons//edit', LiveLessonEditView.as_view(), name='lessons-edit'), - path('lessons//', LiveLessonsDetailView.as_view(), name='lesson-detail'), - path('', LiveLessonsDetailView.as_view(), name='lesson-detail'), + path('lessons//', LiveLessonsDetailView.as_view(), name='lesson-detail-id'), + re_path(r'(?P\d+\-\d+\-\d+)', LiveLessonsDetailView.as_view(), name='lesson-detail'), ]