Edition UEs: renumérote si besoin
This commit is contained in:
parent
c64ab94494
commit
aca96b7c49
@ -653,6 +653,12 @@ def ue_table(formation_id=None, semestre_idx=1, msg=""): # was ue_list
|
|||||||
ues_obj = UniteEns.query.filter_by(
|
ues_obj = UniteEns.query.filter_by(
|
||||||
formation_id=formation_id, is_external=False
|
formation_id=formation_id, is_external=False
|
||||||
).order_by(UniteEns.semestre_idx, UniteEns.numero)
|
).order_by(UniteEns.semestre_idx, UniteEns.numero)
|
||||||
|
# safety check: renumérote les ue s'il en manque ou s'il y a des ex-aequo.
|
||||||
|
# cela facilite le travail de la passerelle !
|
||||||
|
numeros = {ue.numero for ue in ues_obj}
|
||||||
|
if (None in numeros) or len(numeros) < ues_obj.count():
|
||||||
|
scu.objects_renumber(db, ues_obj)
|
||||||
|
|
||||||
ues_externes_obj = UniteEns.query.filter_by(
|
ues_externes_obj = UniteEns.query.filter_by(
|
||||||
formation_id=formation_id, is_external=True
|
formation_id=formation_id, is_external=True
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user