fix edit ordre UEs
This commit is contained in:
parent
453f11084b
commit
c6c7187c34
@ -378,7 +378,10 @@ def ue_move(ue_id, after=0, redirect=1):
|
||||
after = int(after) # 0: deplace avant, 1 deplace apres
|
||||
if after not in (0, 1):
|
||||
raise ValueError('invalid value for "after"')
|
||||
others = ue.formation.ues.order_by(UniteEns.numero).all()
|
||||
others_q = ue.formation.ues.order_by(UniteEns.numero)
|
||||
if ue.formation.is_apc():
|
||||
others_q = others_q.filter_by(semestre_idx=ue.semestre_idx)
|
||||
others = others_q.all()
|
||||
if len({o.numero for o in others}) != len(others):
|
||||
# il y a des numeros identiques !
|
||||
scu.objects_renumber(db, others)
|
||||
|
Loading…
Reference in New Issue
Block a user