Skip to content
Snippets Groups Projects
Commit f189f9cd authored by Paul Milleville's avatar Paul Milleville
Browse files

controle de création de la partition

parent aa614c53
No related branches found
No related tags found
No related merge requests found
......@@ -269,16 +269,18 @@ def formsemestre_synchro_etuds(
list_partition = sco_groups.get_partitions_list(formsemestre_id=formsemestre_id)
partition_id = None
for partition in list_partition:
# Vérifie si une partition avec le nom "Groupe Apogée" existe déjà
partition_exists = False
for partition in partitions:
if partition['partition_name'] == 'Groupe Apogée':
partition_id = partition['partition_id']
break
print(partition_id)
sco_groups.partition_create(formsemestre_id=formsemestre_id,partition_name="Groupe Apogée")
partition_exists = True
break # La partition existe déjà, on peut arrêter la recherche
# Si la partition n'existe pas, on la crée
if not partition_exists:
formsemestre_id = 1031 # Remplace cette valeur si nécessaire
# Appel à la méthode de création de partition
sco_groups.partition_create(formsemestre_id=formsemestre_id, partition_name="Groupe Apogée")
#
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment