fix(crud): resolve poc_person_id and poc_event_person_id FKs correctly
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user