Fix: Fix planer when students_csv is empty
This commit is contained in:
parent
69b2e1c82e
commit
9d7f779f07
@ -23,11 +23,13 @@ def build_subject_list_from_qty(qty: int) -> list[dict]:
|
||||
def planner(options: dict) -> list[Task]:
|
||||
try:
|
||||
students_csv = options["students_csv"]
|
||||
assert options["students_csv"] != ""
|
||||
|
||||
except KeyError:
|
||||
except (KeyError, AssertionError):
|
||||
try:
|
||||
quantity_subjects = options["quantity_subjects"]
|
||||
except KeyError:
|
||||
assert options["quantity_subjects"] != 0
|
||||
except (KeyError, AssertionError):
|
||||
raise PlannerMissingOption("students_csv or quantity_subjects is required")
|
||||
else:
|
||||
options["subjects"] = build_subject_list_from_qty(qty=quantity_subjects)
|
||||
|
Loading…
Reference in New Issue
Block a user