Merged in fix/handle-none-lus (pull request #305)
Ignore learning units that are none
This commit is contained in:
commit
fd123f3377
|
|
@ -51,10 +51,18 @@ def competences(
|
|||
page_id: Page.objects.get(id=page_id).specific.learning_unit
|
||||
for page_id in unique_page_ids
|
||||
}
|
||||
circles = {lu.id: lu.get_circle() for lu in learning_units.values()}
|
||||
circles = {
|
||||
lu.id: c
|
||||
for lu in learning_units.values()
|
||||
if lu is not None and (c := lu.get_circle()) is not None
|
||||
}
|
||||
|
||||
for completion in completions:
|
||||
learning_unit = learning_units.get(completion.page.id)
|
||||
|
||||
if not learning_unit:
|
||||
continue
|
||||
|
||||
circle = circles.get(learning_unit.id)
|
||||
|
||||
combined_id = f"{circle.id}-{completion.course_session.id}"
|
||||
|
|
|
|||
Loading…
Reference in New Issue