From a2c8b85172488a034ab2198095ea54089f44fd99 Mon Sep 17 00:00:00 2001
From: "paul.milleville.etu" <paul.milleville.etu@univ-lille.fr>
Date: Fri, 28 Feb 2025 11:00:12 +0100
Subject: [PATCH] =?UTF-8?q?Fix=20bug=20controle=20cr=C3=A9ation?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 app/scodoc/sco_synchro_etuds.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/app/scodoc/sco_synchro_etuds.py b/app/scodoc/sco_synchro_etuds.py
index 5e9f0885..099eebc3 100644
--- a/app/scodoc/sco_synchro_etuds.py
+++ b/app/scodoc/sco_synchro_etuds.py
@@ -270,17 +270,20 @@ def formsemestre_synchro_etuds(
             list_partition = sco_groups.get_partitions_list(formsemestre_id=formsemestre_id)
 
             # Vérifie si une partition avec le nom "Groupe Apogée" existe déjà
+            partition_id =None
             partition_exists = False
-            for partition in partitions:
+            for partition in list_partition:
                 if partition['partition_name'] == 'Groupe Apogée':
                     partition_exists = True
+                    partition_id = partition['partition_id']
                     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")
+            
+            print(partition_id)
 
 
             #
-- 
GitLab