mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-16 18:22:17 -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:
@@ -109,6 +109,7 @@ def persist_notification(
|
||||
notification.normalised_to = format_email_address(notification.to)
|
||||
elif notification_type == LETTER_TYPE:
|
||||
notification.postage = postage or template_postage
|
||||
notification.normalised_to = ''.join(notification.to.split()).lower()
|
||||
|
||||
# if simulated create a Notification model to return but do not persist the Notification to the dB
|
||||
if not simulated:
|
||||
|
||||
Reference in New Issue
Block a user