Skip to content

Commit

Permalink
fix: hotfix for malformed types (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
sg-s authored Nov 14, 2024
1 parent b20a75f commit 8331d1a
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/data_hub/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1132,15 +1132,27 @@ def _row_to_dict(
value = value.selected_options

elif field.type == "reference":
value = field.value.row_ids
value = field.value
if isinstance(value, dict):
value = value["rowIds"]
else:
value = value.row_ids
reference_ids.extend(value)
elif field.type == "file":
value = field.value.file_ids
value = field.value
if isinstance(value, dict):
value = value["fileIds"]
else:
value = value.file_ids
file_ids.extend(value)
elif field.type == "expression":
value = field.value.result
elif field.type == "user":
user_ids = field.value.user_drns
value = field.value
if isinstance(value, dict):
user_ids = value["userDrns"]
else:
user_ids = value.user_drns

# convert to names using the platform API
value = [get_user_name(user_id) for user_id in user_ids]
Expand Down

0 comments on commit 8331d1a

Please sign in to comment.