Merge pull request #764 from alphagov/more-breaking-utils-changes

Update utils to 12.1.1
This commit is contained in:
Chris Hill-Scott
2016-12-14 17:46:15 +01:00
committed by GitHub
14 changed files with 70 additions and 99 deletions

View File

@@ -42,7 +42,7 @@ def post_sms_notification():
send_notification_to_queue(notification, service.research_mode)
sms_sender = service.sms_sender if service.sms_sender else current_app.config.get('FROM_NUMBER')
resp = create_post_sms_response_from_notification(notification,
template_with_content.rendered,
str(template_with_content),
sms_sender,
request.url_root)
return jsonify(resp), 201
@@ -70,7 +70,7 @@ def post_email_notification():
send_notification_to_queue(notification, service.research_mode)
resp = create_post_email_response_from_notification(notification=notification,
content=template_with_content.rendered,
content=str(template_with_content),
subject=template_with_content.subject,
email_from=service.email_from,
url_root=request.url_root)
@@ -89,5 +89,6 @@ def __validate_template(form, service, notification_type):
check_template_is_for_notification_type(notification_type, template.template_type)
check_template_is_active(template)
template_with_content = create_content_for_notification(template, form.get('personalisation', {}))
check_sms_content_char_count(template_with_content.content_count)
if template.template_type == SMS_TYPE:
check_sms_content_char_count(template_with_content.content_count)
return template, template_with_content