Ignore learning units that are none
This commit is contained in:
parent
ade020614f
commit
51ea7a7f7c
|
|
@ -51,10 +51,18 @@ def competences(
|
||||||
page_id: Page.objects.get(id=page_id).specific.learning_unit
|
page_id: Page.objects.get(id=page_id).specific.learning_unit
|
||||||
for page_id in unique_page_ids
|
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:
|
for completion in completions:
|
||||||
learning_unit = learning_units.get(completion.page.id)
|
learning_unit = learning_units.get(completion.page.id)
|
||||||
|
|
||||||
|
if not learning_unit:
|
||||||
|
continue
|
||||||
|
|
||||||
circle = circles.get(learning_unit.id)
|
circle = circles.get(learning_unit.id)
|
||||||
|
|
||||||
combined_id = f"{circle.id}-{completion.course_session.id}"
|
combined_id = f"{circle.id}-{completion.course_session.id}"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue