fix: exclude account_id and virtual fields from archive_content DB writes

- Adds fields_to_exclude_from_db to Archive_Content_Base to prevent SQL errors on non-existent columns.
- Updates documentation for V3 Create/Update patterns and the x-ae-ignore-extra-fields header.
- Propagates account_id_random to hosted file and media processing methods.
This commit is contained in:
Scott Idem
2026-02-24 11:30:17 -05:00
parent 719ca5240b
commit 9d89d4c8e4
6 changed files with 45 additions and 1 deletions

View File

@@ -272,6 +272,8 @@ async def save_file(
file_info: dict = {}
file_info['saved'] = None
file_info['account_id'] = account_id
file_info['account_id_random'] = account_id_random
file_info['link_to_type'] = link_to_type
file_info['link_to_id'] = link_to_id
file_info['link_to_id_random'] = link_to_id_random
@@ -344,6 +346,8 @@ async def save_file_to_hosted_file(
account_id: int,
link_to_type: str,
link_to_id: int,
account_id_random: str = None,
link_to_id_random: str = None,
):
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.debug(locals())
@@ -353,8 +357,11 @@ async def save_file_to_hosted_file(
file_info: dict = {}
file_info['saved'] = None
file_info['account_id'] = account_id
file_info['account_id_random'] = account_id_random
file_info['link_to_type'] = link_to_type
file_info['link_to_id'] = link_to_id
file_info['link_to_id_random'] = link_to_id_random
file_info['filename'] = filename
file_info['extension'] = extension
file_info['content_type'] = mimetypes.guess_type(filename)[0]