Skip to content

Commit

Permalink
print clean_kobo
Browse files Browse the repository at this point in the history
  • Loading branch information
jmargutt committed Dec 7, 2023
1 parent 797853b commit 0a12a1a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,12 @@ def clean_kobo_data(kobo_data):
# remove group names
for key in list(kobo_data_clean.keys()):
new_key = key.split('/')[-1]
# if new_key not in kobo_data_clean.keys():
kobo_data_clean[new_key] = kobo_data_clean.pop(key)
# else:
# new_value = kobo_data_clean.pop(key)
# if kobo_data_clean[new_key] == "" or kobo_data_clean[new_key] is None:
# kobo_data_clean[new_key] = new_value
return kobo_data_clean


Expand All @@ -105,7 +110,9 @@ async def kobo_to_espocrm(request: Request, dependencies=Depends(required_header
client = EspoAPI(request.headers['targeturl'], request.headers['targetkey'])

kobo_data = await request.json()
logging.info(kobo_data)
kobo_data = clean_kobo_data(kobo_data)
logging.info(kobo_data)
attachments = get_attachment_dict(kobo_data)

# check if records need to be updated
Expand Down

0 comments on commit 0a12a1a

Please sign in to comment.