One off letter flow does not allow to send letter longer than 10 pages

This commit is contained in:
Pea Tyczynska
2019-10-01 14:31:36 +01:00
parent 0adf80f294
commit c690434b1f
3 changed files with 47 additions and 2 deletions

View File

@@ -850,6 +850,7 @@ def _check_notification(service_id, template_id, exception=None):
email_reply_to = get_email_reply_to_address_from_session()
elif db_template['template_type'] == 'sms':
sms_sender = get_sms_sender_from_session()
page_count = get_page_count_for_letter(db_template)
template = get_template(
db_template,
current_service,
@@ -862,7 +863,7 @@ def _check_notification(service_id, template_id, exception=None):
template_id=template_id,
filetype='png',
),
page_count=get_page_count_for_letter(db_template),
page_count=page_count,
)
back_link = get_back_link(service_id, template, len(fields_to_fill_in(template)))
@@ -881,6 +882,7 @@ def _check_notification(service_id, template_id, exception=None):
template=template,
back_link=back_link,
help=get_help_argument(),
page_count=page_count,
**(get_template_error_dict(exception) if exception else {}),
)

View File

@@ -66,7 +66,7 @@
help='3' if help else 0
)}}" class='page-footer'>
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
{% if not error %}
{% if not error and page_count < 11 %}
<button type="submit" class="button">Send 1 {{ message_count_label(1, template.template_type, suffix='') }}</button>
{% endif %}
{% if template.template_type == 'letter' %}