From 009de7a4ab269f681c3c6b25881d75580f26ab02 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Mon, 11 Jul 2022 21:39:30 +0200 Subject: [PATCH] 2 minor bugs --- app/scodoc/sco_formations.py | 2 ++ app/scodoc/sco_formsemestre_edit.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/scodoc/sco_formations.py b/app/scodoc/sco_formations.py index ae6ecc0b6..4526ae634 100644 --- a/app/scodoc/sco_formations.py +++ b/app/scodoc/sco_formations.py @@ -89,6 +89,8 @@ def formation_list(formation_id=None, args={}): def formation_has_locked_sems(formation_id): # XXX to remove "backward compat: True if there is a locked formsemestre in this formation" formation = Formation.query.get(formation_id) + if formation is None: + return False return formation.has_locked_sems() diff --git a/app/scodoc/sco_formsemestre_edit.py b/app/scodoc/sco_formsemestre_edit.py index cf24c4b0c..507e409fa 100644 --- a/app/scodoc/sco_formsemestre_edit.py +++ b/app/scodoc/sco_formsemestre_edit.py @@ -1785,7 +1785,7 @@ def get_formsemestre_session_id(sem, F, parcours): "ImputationDept", sem["formsemestre_id"] ) if not imputation_dept: - imputation_dept = sco_preferences.get_preference("DeptName") + imputation_dept = sco_preferences.get_preference("DeptName") or "" imputation_dept = imputation_dept.upper() parcours_type = parcours.NAME modalite = sem["modalite"]