Child objects in the nested endpoint inherit account context from their parent via the FK relationship and do not carry their own account_id column (e.g. event_badge, journal_entry). Injecting account_id into data_to_insert would cause INSERT failures for any child whose table has no account_id column but whose model has the field (from the view). The original code set account_id in obj_data before model instantiation, where the root_validator immediately stripped it — a harmless no-op. The previous commit turned that dead line into a live injection by moving it after serialization, which would break journal_entry creates on non-bypass auth. Removed entirely. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
28 KiB
28 KiB