fix for non-sectioned lessons nav
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Thu, 20 Jun 2013 12:42:24 +0000 (14:42 +0200)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Thu, 20 Jun 2013 12:42:24 +0000 (14:42 +0200)
catalogue/templatetags/catalogue_tags.py

index abaa524..32a5a0b 100755 (executable)
@@ -38,7 +38,7 @@ def section_box(section):
 def lesson_nav(lesson):
     if lesson.type == 'course':
         root = lesson.section
 def lesson_nav(lesson):
     if lesson.type == 'course':
         root = lesson.section
-        siblings = root.lesson_set.filter(type='course', level=lesson.level)
+        siblings = Lesson.objects.filter(type='course', level=lesson.level, section=root)
         mark_level = False
     else:
         root = None
         mark_level = False
     else:
         root = None