Files
OSIT-AE-API-FastAPI/app/routers/api_v3_actions_event_file.py
Scott Idem 45b2890e27 fix(event_file): use for_type/for_id for hosted_file_link deletion
hosted_file_link is created against the parent object (e.g. event_presenter),
not against event_file itself. The delete endpoint was passing link_to_type=
'event_file', finding 0 rows, and bailing before the orphan cleanup ran.

Fix: read for_type + for_id from the event_file row and use those for link
deletion. Also inline the orphan cleanup so a missing link (old orphan from
the pre-fix period) is treated as a non-fatal warning rather than a hard
failure — cleanup proceeds regardless.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-18 18:27:19 -04:00

16 KiB