fix one more place where senders weren't sanitised

make sure everything is using the `nl2br` formatter that properly wraps
it in markdown to keep everything sanitised nicely. Also write a couple
of tests
This commit is contained in:
Leo Hemsted
2020-01-22 16:13:25 +00:00
parent 945701c607
commit f3fa6a67e1
6 changed files with 41 additions and 8 deletions

View File

@@ -31,6 +31,7 @@ from xlrd.xldate import XLDateError
from app import (
current_service,
job_api_client,
nl2br,
notification_api_client,
service_api_client,
)
@@ -272,7 +273,7 @@ def get_sender_context(sender_details, template_type):
if context['default_id'] == context.get('receives_text_message', None):
context['default_and_receives'] = context['default_id']
context['value_and_label'] = [(sender['id'], sender[sender_format]) for sender in sender_details]
context['value_and_label'] = [(sender['id'], nl2br(sender[sender_format])) for sender in sender_details]
return context