Fix: objects_renumber

This commit is contained in:
Emmanuel Viennet 2021-12-17 13:42:39 +01:00
parent 8c95edf01c
commit 87bcfc801a
4 changed files with 4 additions and 4 deletions

View File

@ -326,7 +326,7 @@ def module_move(module_id, after=0, redirect=True):
modules = query.order_by(Module.numero, Module.code).all() modules = query.order_by(Module.numero, Module.code).all()
if len({o.numero for o in modules}) != len(modules): if len({o.numero for o in modules}) != len(modules):
# il y a des numeros identiques ! # il y a des numeros identiques !
scu.objects_renumber(modules) scu.objects_renumber(db, modules)
if len(modules) > 1: if len(modules) > 1:
idx = [m.id for m in modules].index(module.id) idx = [m.id for m in modules].index(module.id)
neigh = None # object to swap with neigh = None # object to swap with

View File

@ -1068,7 +1068,7 @@ def partition_move(partition_id, after=0, redirect=1):
) )
if len({o.numero for o in objs}) != len(objs): if len({o.numero for o in objs}) != len(objs):
# il y a des numeros identiques ! # il y a des numeros identiques !
scu.objects_renumber(objs) scu.objects_renumber(db, objs)
if len(others) > 1: if len(others) > 1:
pidx = [p["partition_id"] for p in others].index(partition_id) pidx = [p["partition_id"] for p in others].index(partition_id)

View File

@ -992,7 +992,7 @@ def confirm_dialog(
return "\n".join(H) return "\n".join(H)
def objects_renumber(obj_list) -> None: def objects_renumber(db, obj_list) -> None:
"""fixe les numeros des objets d'une liste de modèles """fixe les numeros des objets d'une liste de modèles
pour ne pas changer son ordre""" pour ne pas changer son ordre"""
log(f"objects_renumber {obj_list}") log(f"objects_renumber {obj_list}")

View File

@ -1,7 +1,7 @@
# -*- mode: python -*- # -*- mode: python -*-
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
SCOVERSION = "9.1.9" SCOVERSION = "9.1.10"
SCONAME = "ScoDoc" SCONAME = "ScoDoc"