mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 09:26:08 -05:00
Save whole letter address into the to field
At the moment we’re not consistent: Precompiled (API and one-off): `to` has the whole address `normalised_to` has nothing Templated (API, CSV and one off): `to` has the first line of the address `normalised_to` has nothing This commit makes us consistently store the whole address in the `to` field. We think that people might want to search by postcode, not just first line of the address. This commit also starts to populate the normalised_to field with the address lowercased and with all spaces removed, to make it easier to search on.
This commit is contained in:
@@ -345,7 +345,7 @@ def save_letter(
|
||||
# we store the recipient as just the first item of the person's address
|
||||
recipient = PostalAddress.from_personalisation(
|
||||
Columns(notification['personalisation'])
|
||||
).normalised_lines[0]
|
||||
).normalised
|
||||
|
||||
service = dao_fetch_service_by_id(service_id)
|
||||
template = dao_get_template_by_id(notification['template'], version=notification['template_version'])
|
||||
|
||||
Reference in New Issue
Block a user