mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-21 07:51:13 -05:00
We're hiding the `service_letter_contact_id` column since it should only be readable and writable using the `.reply_to` wrapper. Schemas are defined using `fields.Method` since the fields are represented by a property on the Template model that requires template type to be set. When creating a template, if `reply_to` is defined using `fields.String` it gets assigned at the same time as `template_type` (or the order of assignments is not defined), so the schema loader attempts to set `.reply_to` on a Template object with a `None` `template_type`, which raises an exception. Using `fields.Method` seems to delay `.reply_to` assignment until the Template object is created, which means it already has a valid type.
22 KiB
22 KiB