API: numero groupe par defaut

This commit is contained in:
Emmanuel Viennet 2024-01-28 22:36:33 +01:00
parent 9be77e4f37
commit 8652ef2e7b
2 changed files with 8 additions and 1 deletions

View File

@ -311,6 +311,13 @@ def group_create(partition_id: int): # partition-group-create
args["group_name"] = args["group_name"].strip()
if not GroupDescr.check_name(partition, args["group_name"]):
return json_error(API_CLIENT_ERROR, "invalid group_name")
# le numero est optionnel
numero = args.get("numero")
if numero is None:
numeros = [gr.numero or 0 for gr in partition.groups]
numero = (max(numeros) + 1) if numeros else 0
args["numero"] = numero
args["partition_id"] = partition_id
try:
group = GroupDescr(**args)

View File

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