mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-02 12:49:01 -04:00
Add postal address row errors
Context: - postal addresses can be made from any of the 7 address lines now, and the postcode can be in any one of the 7 - we can put errors across a whole row now, not just on individual cells This commit put errors to do with the postal address as a whole across the whole row now, rather than tying them to any one cell.
This commit is contained in:
@@ -711,6 +711,8 @@ def _check_messages(service_id, template_id, upload_id, preview_row, letters_as_
|
||||
),
|
||||
letter_too_long=is_letter_too_long(page_count),
|
||||
letter_max_pages=LETTER_MAX_PAGE_COUNT,
|
||||
letter_min_address_lines=PostalAddress.MIN_LINES,
|
||||
letter_max_address_lines=PostalAddress.MAX_LINES,
|
||||
page_count=page_count
|
||||
)
|
||||
|
||||
|
||||
@@ -80,6 +80,12 @@
|
||||
No content for this message
|
||||
{% elif item.message_too_long %}
|
||||
Message is too long
|
||||
{% elif not item.as_postal_address.has_enough_lines %}
|
||||
Address must be at least {{ letter_min_address_lines }} lines long
|
||||
{% elif item.as_postal_address.has_too_many_lines %}
|
||||
Address must be no more than {{ letter_max_address_lines }} lines long
|
||||
{% elif not item.as_postal_address.postcode %}
|
||||
Last line of the address must be a real UK postcode
|
||||
{% endif %}
|
||||
</span>
|
||||
{% endcall %}
|
||||
|
||||
Reference in New Issue
Block a user