N'impose pas la présence de codes Apogée sur les éléments des semestres extérieurs

This commit is contained in:
Emmanuel Viennet 2022-09-30 23:29:06 +02:00
parent 4f87f22586
commit 2731a4728b
1 changed files with 11 additions and 4 deletions

View File

@ -414,7 +414,8 @@ def do_formsemestre_createwithmodules(edit=False):
"explanation": "associé(s) au résultat du semestre (ex: VRTW1). Inutile en BUT. Séparés par des virgules.",
"allow_null": not sco_preferences.get_preference(
"always_require_apo_sem_codes"
),
)
or formsemestre.modalite == "EXT",
},
)
)
@ -427,7 +428,8 @@ def do_formsemestre_createwithmodules(edit=False):
"explanation": "associé(s) au résultat de l'année (ex: VRT1A). Séparés par des virgules.",
"allow_null": not sco_preferences.get_preference(
"always_require_apo_sem_codes"
),
)
or formsemestre.modalite == "EXT",
},
)
)
@ -740,8 +742,13 @@ def do_formsemestre_createwithmodules(edit=False):
# check dates
if ndb.DateDMYtoISO(tf[2]["date_debut"]) > ndb.DateDMYtoISO(tf[2]["date_fin"]):
msg = '<ul class="tf-msg"><li class="tf-msg">Dates de début et fin incompatibles !</li></ul>'
if sco_preferences.get_preference("always_require_apo_sem_codes") and not any(
[tf[2]["etape_apo" + str(n)] for n in range(0, scu.EDIT_NB_ETAPES + 1)]
if (
formsemestre.modalite
!= "EXT" # n'impose pas d'Apo pour les sem. extérieurs
and sco_preferences.get_preference("always_require_apo_sem_codes")
and not any(
[tf[2]["etape_apo" + str(n)] for n in range(0, scu.EDIT_NB_ETAPES + 1)]
)
):
msg = '<ul class="tf-msg"><li class="tf-msg">Code étape Apogée manquant</li></ul>'