Merge branch 'hotfix/lessons_error_15-01-19' into 'master'

при редактировании уроков возникает 500 ошибка

See merge request lilschool/site!247
remotes/origin/hotfix/LIL-731^2
Danil 7 years ago
commit 248539963c
  1. 2
      apps/school/models.py
  2. 2
      apps/school/templates/school/livelessons_list.html
  3. 6
      apps/school/urls.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]

@ -11,7 +11,7 @@
{% for livelesson in livelesson_list %}
<div class="lessons__item">
<div class="lessons__actions lessons__actions__no-hover">
<a target="_blank" class="lessons__action" href="{{ live_lesson.url }}">
<a target="_blank" class="lessons__action" href="{{ livelesson.url }}">
<svg class="icon icon-eye">
<use xlink:href="{% static 'img/sprite.svg' %}#icon-eye"></use>
</svg>

@ -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/<int:pk>/edit', LiveLessonEditView.as_view(), name='lessons-edit'),
path('lessons/<int:pk>/', LiveLessonsDetailView.as_view(), name='lesson-detail'),
path('<str:lesson_date>', LiveLessonsDetailView.as_view(), name='lesson-detail'),
path('lessons/<int:pk>/', LiveLessonsDetailView.as_view(), name='lesson-detail-id'),
re_path(r'(?P<lesson_date>\d+\-\d+\-\d+)', LiveLessonsDetailView.as_view(), name='lesson-detail'),
]

Loading…
Cancel
Save