Saving fixes to the hosted file delete function.

This commit is contained in:
Scott Idem
2026-01-22 17:31:29 -05:00
parent 1e6b9d1c18
commit df0ce7f910
2 changed files with 83 additions and 4 deletions

View File

@@ -458,7 +458,7 @@ async def upload_files(
link_to_id_random = link_to_id_random,
check_allowed_extension = check_allowed_extension,
)
hosted_file_id = None
hosted_file_dict = {}
@@ -858,10 +858,11 @@ async def test_upload_files(
async def delete_hosted_file(
hosted_file_id: str = Path(min_length=11, max_length=22),
link_to_type: str = None,
link_to_id: Union[int, str] = None,
# These are needed to identify the hosted_file_link record to be deleted
link_to_type: str = None, # Type of object the hosted file is linked to
link_to_id: Union[int, str] = None, # ID of the object the hosted file is linked to
rm_orphan: bool = False,
rm_orphan: bool = False, # Whether to remove orphaned files
commons: Common_Route_Params = Depends(common_route_params),
):