forked from ScoDoc/ScoDoc
Fix create modules / tests ok.
This commit is contained in:
parent
b7d4939e4c
commit
9f0bcbc937
@ -228,9 +228,11 @@ class Module(models.ScoDocModel):
|
|||||||
formation = data.get("formation")
|
formation = data.get("formation")
|
||||||
if formation is None or not isinstance(formation, Formation):
|
if formation is None or not isinstance(formation, Formation):
|
||||||
raise ScoValueError("Module.create_from_dict: formation missing")
|
raise ScoValueError("Module.create_from_dict: formation missing")
|
||||||
else: # check ue_id
|
else:
|
||||||
formation = UniteEns.get_ue(data["ue_id"])
|
formation = Formation.get_formation(data["formation_id"])
|
||||||
# formation = Formation.get_formation(data["formation_id"])
|
#
|
||||||
|
if ue.formation_id != formation.id:
|
||||||
|
raise ScoValueError("Module.create_from_dict: UE not in formation")
|
||||||
# refuse de créer un module APC avec semestres semestre du module != semestre de l'UE
|
# refuse de créer un module APC avec semestres semestre du module != semestre de l'UE
|
||||||
if formation.is_apc():
|
if formation.is_apc():
|
||||||
if int(data.get("semestre_id", 1)) != ue.semestre_idx:
|
if int(data.get("semestre_id", 1)) != ue.semestre_idx:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user