Fix: codes Apogée nulls

This commit is contained in:
Emmanuel Viennet 2022-02-08 23:58:02 +01:00
parent 9fc4e83811
commit 7a183185a2
3 changed files with 10 additions and 4 deletions

View File

@ -63,6 +63,7 @@ class Module(db.Model):
e["numero"] = 0 if self.numero is None else self.numero e["numero"] = 0 if self.numero is None else self.numero
e["coefficient"] = 0.0 if self.coefficient is None else self.coefficient e["coefficient"] = 0.0 if self.coefficient is None else self.coefficient
e["module_type"] = 0 if self.module_type is None else self.module_type e["module_type"] = 0 if self.module_type is None else self.module_type
e["code_apogee"] = e["code_apogee"] or "" # pas de None
return e return e
def is_apc(self): def is_apc(self):

View File

@ -62,6 +62,7 @@ class UniteEns(db.Model):
e["numero"] = e["numero"] if e["numero"] else 0 e["numero"] = e["numero"] if e["numero"] else 0
e["ects"] = e["ects"] if e["ects"] else 0.0 e["ects"] = e["ects"] if e["ects"] else 0.0
e["coefficient"] = e["coefficient"] if e["coefficient"] else 0.0 e["coefficient"] = e["coefficient"] if e["coefficient"] else 0.0
e["code_apogee"] = e["code_apogee"] or "" # pas de None
return e return e
def is_locked(self): def is_locked(self):

View File

@ -413,7 +413,7 @@ class ApoEtud(dict):
# Elements UE # Elements UE
decisions_ue = nt.get_etud_decision_ues(etudid) decisions_ue = nt.get_etud_decision_ues(etudid)
for ue in nt.get_ues_stat_dict(): for ue in nt.get_ues_stat_dict():
if code in ue["code_apogee"].split(","): if ue["code_apogee"] and code in ue["code_apogee"].split(","):
if self.export_res_ues: if self.export_res_ues:
if decisions_ue and ue["ue_id"] in decisions_ue: if decisions_ue and ue["ue_id"] in decisions_ue:
ue_status = nt.get_etud_ue_status(etudid, ue["ue_id"]) ue_status = nt.get_etud_ue_status(etudid, ue["ue_id"])
@ -434,7 +434,9 @@ class ApoEtud(dict):
modimpls = nt.get_modimpls_dict() modimpls = nt.get_modimpls_dict()
module_code_found = False module_code_found = False
for modimpl in modimpls: for modimpl in modimpls:
if code in modimpl["module"]["code_apogee"].split(","): if modimpl["module"]["code_apogee"] and code in modimpl["module"][
"code_apogee"
].split(","):
n = nt.get_etud_mod_moy(modimpl["moduleimpl_id"], etudid) n = nt.get_etud_mod_moy(modimpl["moduleimpl_id"], etudid)
if n != "NI" and self.export_res_modules: if n != "NI" and self.export_res_modules:
return dict(N=_apo_fmt_note(n), B=20, J="", R="") return dict(N=_apo_fmt_note(n), B=20, J="", R="")
@ -947,13 +949,15 @@ class ApoData(object):
# associé à une UE: # associé à une UE:
nt = sco_cache.NotesTableCache.get(sem["formsemestre_id"]) nt = sco_cache.NotesTableCache.get(sem["formsemestre_id"])
for ue in nt.get_ues_stat_dict(): for ue in nt.get_ues_stat_dict():
if code in ue["code_apogee"].split(","): if ue["code_apogee"] and code in ue["code_apogee"].split(","):
s.add(code) s.add(code)
continue continue
# associé à un module: # associé à un module:
modimpls = nt.get_modimpls_dict() modimpls = nt.get_modimpls_dict()
for modimpl in modimpls: for modimpl in modimpls:
if code in modimpl["module"]["code_apogee"].split(","): if modimpl["module"]["code_apogee"] and code in modimpl["module"][
"code_apogee"
].split(","):
s.add(code) s.add(code)
continue continue
# log('codes_by_sem=%s' % pprint.pformat(codes_by_sem)) # log('codes_by_sem=%s' % pprint.pformat(codes_by_sem))