From c6bfa7a516c92e7a7f397367bf6fcb3dab461038 Mon Sep 17 00:00:00 2001 From: jmargutti Date: Thu, 21 Mar 2024 13:09:23 +0100 Subject: [PATCH] extend regex for attachments --- main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index f7430aa..7d5db61 100644 --- a/main.py +++ b/main.py @@ -4,7 +4,7 @@ from fastapi.responses import RedirectResponse, JSONResponse from fastapi.security.api_key import APIKeyHeader, APIKey from pydantic import BaseModel -from enum import Enum +import re from time import sleep from clients.espo_api_client import EspoAPI import requests @@ -242,6 +242,7 @@ async def kobo_to_espocrm(request: Request, dependencies=Depends(required_header # process individual field; if it's an attachment, upload it to EspoCRM kobo_value_url = str(kobo_value).replace(" ", "_") + kobo_value_url = re.sub(r"[(,),']", "", kobo_value_url) if kobo_value_url not in attachments.keys(): payload[target_entity][target_field] = kobo_value else: