Merge pull request #1279 from alphagov/placeholders-in-contact-block

Enable placeholders in letter contact block
This commit is contained in:
Chris Hill-Scott
2017-05-23 14:39:00 +01:00
committed by GitHub
5 changed files with 13 additions and 5 deletions

View File

@@ -502,7 +502,11 @@ class ServiceSmsSender(Form):
class ServiceLetterContactBlock(Form):
letter_contact_block = TextAreaField()
letter_contact_block = TextAreaField(
validators=[
NoCommasInPlaceHolders()
]
)
def validate_letter_contact_block(form, field):
line_count = field.data.strip().count('\n')

View File

@@ -14,6 +14,8 @@ from flask_login import (
login_required,
current_user
)
from notifications_utils.field import Field
from notifications_python_client.errors import HTTPError
from app import service_api_client
@@ -46,7 +48,8 @@ def service_settings(service_id):
organisation=organisation,
letter_branding=letter_branding_organisations.get(
current_service.get('dvla_organisation', '001')
)
),
letter_contact_block=Field(current_service['letter_contact_block'], html='escape')
)