3 petits correctifs (bulletins anciens)

This commit is contained in:
Emmanuel Viennet 2022-02-11 08:52:09 +01:00
parent 2ad1c4eed2
commit 53dc7e7529
4 changed files with 13 additions and 4 deletions

View File

@ -175,7 +175,7 @@ def bulletin_but_xml_compat(
x_ue.append(Element("rang", value=str(rang_ue))) x_ue.append(Element("rang", value=str(rang_ue)))
x_ue.append(Element("effectif", value=str(nb_inscrits_ue))) x_ue.append(Element("effectif", value=str(nb_inscrits_ue)))
# Liste les modules rattachés à cette UE # Liste les modules rattachés à cette UE
for modimpl in results.modimpls: for modimpl in results.formsemestre.modimpls:
# Liste ici uniquement les modules rattachés à cette UE # Liste ici uniquement les modules rattachés à cette UE
if modimpl.module.ue.id == ue.id: if modimpl.module.ue.id == ue.id:
# mod_moy = scu.fmt_note(results.etud_moy_ue[ue.id][etud.id]) # mod_moy = scu.fmt_note(results.etud_moy_ue[ue.id][etud.id])

View File

@ -254,7 +254,10 @@ def formsemestre_bulletinetud_published_dict(
m["note"][k] = scu.fmt_note(m["note"][k]) m["note"][k] = scu.fmt_note(m["note"][k])
u["module"].append(m) u["module"].append(m)
if sco_preferences.get_preference("bul_show_mod_rangs", formsemestre_id): if (
sco_preferences.get_preference("bul_show_mod_rangs", formsemestre_id)
and nt.mod_rangs is not None
):
m["rang"] = dict( m["rang"] = dict(
value=nt.mod_rangs[modimpl["moduleimpl_id"]][0][etudid] value=nt.mod_rangs[modimpl["moduleimpl_id"]][0][etudid]
) )

View File

@ -271,7 +271,10 @@ def make_xml_formsemestre_bulletinetud(
moy=scu.fmt_note(modstat["moy"]), moy=scu.fmt_note(modstat["moy"]),
) )
) )
if sco_preferences.get_preference("bul_show_mod_rangs", formsemestre_id): if (
sco_preferences.get_preference("bul_show_mod_rangs", formsemestre_id)
and nt.mod_rangs is not None
):
x_mod.append( x_mod.append(
Element( Element(
"rang", "rang",

View File

@ -227,7 +227,10 @@ def get_mention(moy):
moy = float(moy) moy = float(moy)
except: except:
return "" return ""
if moy > 0.0:
return NOTES_MENTIONS_LABS[bisect.bisect_right(NOTES_MENTIONS_TH, moy)] return NOTES_MENTIONS_LABS[bisect.bisect_right(NOTES_MENTIONS_TH, moy)]
else:
return ""
class DictDefault(dict): # obsolete, use collections.defaultdict class DictDefault(dict): # obsolete, use collections.defaultdict