Skip to content

Commit

Permalink
extend regex for attachments
Browse files Browse the repository at this point in the history
  • Loading branch information
jmargutt committed Mar 21, 2024
1 parent ab30d0f commit c6bfa7a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit c6bfa7a

Please sign in to comment.