Browse Source

implement 2026 gsheet parser

tripeur 3 ngày trước cách đây
mục cha
commit
0a9d010162
2 tập tin đã thay đổi với 6 bổ sung3 xóa
  1. 5 2
      app/api/endpoints/project.py
  2. 1 1
      app/importData/gsheet.py

+ 5 - 2
app/api/endpoints/project.py

@@ -258,8 +258,11 @@ async def update_project_from_gsheet(
             required_volunteers=len(volunteers),
         )
         for benevole_key in unique_volunteers:
-            if benevole_key in volunteer_map:
-                slot.volunteers.append(volunteer_map[benevole_key])
+            key = benevole_key.strip()
+            if key in volunteer_map:
+                slot.volunteers.append(volunteer_map[key])
+            else:
+                print("volunteer unknown "+ key)
 
         template_id = group.template_id.iloc[0]
         if template_id in template_map:

+ 1 - 1
app/importData/gsheet.py

@@ -127,7 +127,7 @@ def getContactDataFrame(csv_filename: str, skiprows: int = 2) -> DataFrame[Conta
     # coerce SMS to boolean
     df_contact["SMS"] = df_contact["OK pour SMS"] == "X"
     # create unique contact key
-    df_contact["key"] = df_contact["Prénom N"]
+    df_contact["key"] = df_contact["Prénom N"].str.strip()
     return ContactSchema.validate(df_contact)