From 2d611a28728aba905349a030bb157ef9398859d1 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Fri, 12 Jun 2026 15:46:53 -0400 Subject: [PATCH] fix(crud): resolve poc_person_id and poc_event_person_id FKs correctly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The generic FK resolver derives the lookup table name from the field name, so poc_person_id → 'poc_person' (no such table) — the random string was passed straight to an INT column, producing a MariaDB 1366 error. Adds table name overrides matching the existing address_location → address pattern. Blocking LCI session POC assignment via V3 PATCH. Co-Authored-By: Claude Sonnet 4.6 --- app/lib_api_crud_v3.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/lib_api_crud_v3.py b/app/lib_api_crud_v3.py index 868f55b..3f5c9bf 100644 --- a/app/lib_api_crud_v3.py +++ b/app/lib_api_crud_v3.py @@ -246,6 +246,8 @@ def sanitize_payload(data: dict, model: Any, ignore_extra: bool = False) -> None if target_id_field and obj_type_lookup: # Special table mapping if needed if obj_type_lookup == 'address_location': obj_type_lookup = 'address' + if obj_type_lookup == 'poc_person': obj_type_lookup = 'person' + if obj_type_lookup == 'poc_event_person': obj_type_lookup = 'event_person' resolved_id = redis_lookup_id_random(record_id_random=v, table_name=obj_type_lookup) if resolved_id: