fix for non-sectioned lessons nav
[edumed.git] / catalogue / templatetags / catalogue_tags.py
index fd1fc62..32a5a0b 100755 (executable)
@@ -30,6 +30,7 @@ def section_box(section):
             lessons[lesson.level][lesson.type] = []
         lessons[lesson.level][lesson.type].append(lesson)
     return {
+        "section": section,
         "lessons": lessons,
     }
 
@@ -37,7 +38,7 @@ def section_box(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