Bug fixes for uploading the files. I though the changes being made where not supposed to break legacy endpoints. Not sure what happened. Either way things are almost back to normal.

This commit is contained in:
Scott Idem
2026-01-22 16:49:03 -05:00
parent 48d9e38c39
commit 1e6b9d1c18
8 changed files with 521 additions and 17 deletions

View File

@@ -67,18 +67,18 @@ class Hosted_File_Base(BaseModel):
Vision Transformer:
Map DB keys to clean API keys and strip internal integers.
"""
# 1. Map Random Strings to Clean Names
if rid := values.get('id_random') or values.get('hosted_file_id_random'):
# Only set if not already a valid integer
if not isinstance(values.get('id'), int):
values['id'] = rid
if not isinstance(values.get('hosted_file_id'), int):
values['hosted_file_id'] = rid
# 1. Capture the random ID string
rid = values.get('id_random') or values.get('hosted_file_id_random')
# 2. Map Random Strings to Clean Names for the Frontend
# We always want the string version in 'id' and 'hosted_file_id' for the API response
if rid:
values['id'] = rid
values['hosted_file_id'] = rid
if a_rid := values.get('account_id_random'):
# Only set if not already a valid integer
if not isinstance(values.get('account_id'), int):
values['account_id'] = a_rid
# If we have a random account ID string, use it for the Vision API
values['account_id'] = a_rid
return values