From 9ef4d2507cf092bf4789c1e359f6f79fda3c316d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Reuiller?= Date: Thu, 19 Dec 2024 15:19:59 +0100 Subject: [PATCH] ignore OPCS import and makes the error log generic --- .../management/commands/sync_with_emplois_inclusion.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lemarche/siaes/management/commands/sync_with_emplois_inclusion.py b/lemarche/siaes/management/commands/sync_with_emplois_inclusion.py index 8cdd26ca4..bb1b509ee 100644 --- a/lemarche/siaes/management/commands/sync_with_emplois_inclusion.py +++ b/lemarche/siaes/management/commands/sync_with_emplois_inclusion.py @@ -213,12 +213,14 @@ def filter_c1_export(self, c1_list): c1_list_filtered = [] for c1_siae in c1_list: - if c1_siae["kind"] not in ("RESERVED",): # do nothing if kind is filtered as reserved + if c1_siae["kind"] not in ["RESERVED", "OPCS"]: # do nothing if kind is filtered as reserved if c1_siae["kind"] in siae_constants.KIND_INSERTION_LIST + siae_constants.KIND_HANDICAP_LIST: c1_list_filtered.append(c1_siae) else: logger.error( - f"Kind not supported: {c1_siae['kind']}/{c1_siae['id']}/{c1_siae['name']}/{c1_siae['siret']}" + "Kind not supported: %s", + c1_siae["kind"], + extra=dict(c1_id=c1_siae["id"], c1_name=c1_siae["name"], c1_siret=c1_siae["siret"]), ) return c1_list_filtered