Tell template preview to allow international letters

If a service has permission to send international letters then it should
tell template preview, so that template preview knows what rule to
apply when it’s validating the address of the letter.

Depends on:
- [ ] https://github.com/alphagov/notifications-template-preview/pull/445
This commit is contained in:
Chris Hill-Scott
2020-05-01 14:26:20 +01:00
parent 0c1373eeb5
commit 85fc601886
2 changed files with 25 additions and 3 deletions

View File

@@ -40,6 +40,7 @@ from app.letters.utils import (
get_file_names_from_error_bucket,
)
from app.models import (
INTERNATIONAL_LETTERS,
KEY_TYPE_TEST,
NOTIFICATION_CREATED,
NOTIFICATION_DELIVERED,
@@ -227,6 +228,9 @@ def sanitise_letter(self, filename):
kwargs={
'notification_id': str(notification.id),
'filename': filename,
'allow_international_letters': notification.service.has_permission(
INTERNATIONAL_LETTERS
),
},
queue=QueueNames.SANITISE_LETTERS,
)