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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user