fossunited/mon_school

progress pages are broken

Closed this issue · 3 comments

We have progress pages on mon school at /mon/progress and /mon/student_progress.

Traceback

  File "/home/fossunited/frappe-bench/apps/mon_school/mon_school/www/mon/progress.py", line 16, in get_context
    context.report = BatchReport(course, context.batch)
  File "/home/fossunited/frappe-bench/apps/mon_school/mon_school/www/mon/progress.py", line 66, in __init__
    self.lessons = self.get_lessons()
  File "/home/fossunited/frappe-bench/apps/mon_school/mon_school/www/mon/progress.py", line 75, in get_lessons
    return [lesson
  File "/home/fossunited/frappe-bench/apps/mon_school/mon_school/www/mon/progress.py", line 77, in <listcomp>
    for lesson in c.get_lessons()]
TypeError: 'NoneType' object is not callable

Notes

Looks like this is failing now.

    def get_lessons(self):
        return [lesson
                for c in self.course.get_chapters()
                for lesson in c.get_lessons()]

@pateljannat looks like your recent refactoring of lessons and chapters broke this.

@anandology

In progress.py if you replace the line

self.lessons = self.get_lessons()

with

self.lessons = self.course.get_lessons()

the issue would be resolved. You won't need the get_lessons function of progress.py then.

Let me know if this works

Thanks @pateljannat. That fixed the issue.