Use new value of SMS_CHAR_COUNT_LIMIT from utils

Admin, API and utils were all defining a value for SMS_CHAR_COUNT_LIMIT.
This value has been updated in notifications-utils to allow text
messages to be 4 fragments long and notifications-admin now gets the value of
SMS_CHAR_COUNT_LIMIT from notifications-utils instead of defining it in
config.
This commit is contained in:
Katie Smith
2018-08-16 16:51:32 +01:00
parent cdd828da20
commit 1b6c357dea
4 changed files with 7 additions and 7 deletions

View File

@@ -51,8 +51,6 @@ class Config(object):
SESSION_COOKIE_SECURE = True
SESSION_REFRESH_EACH_REQUEST = True
SHOW_STYLEGUIDE = True
# TODO: move to utils
SMS_CHAR_COUNT_LIMIT = 459
WTF_CSRF_ENABLED = True
WTF_CSRF_TIME_LIMIT = None
CSV_UPLOAD_BUCKET_NAME = 'local-notifications-csv-upload'

View File

@@ -15,6 +15,7 @@ from flask import (
)
from flask_login import current_user, login_required
from notifications_python_client.errors import HTTPError
from notifications_utils import SMS_CHAR_COUNT_LIMIT
from notifications_utils.columns import Columns
from notifications_utils.recipients import (
RecipientCSV,
@@ -852,7 +853,7 @@ def get_template_error_dict(exception):
return {
'error': error,
'SMS_CHAR_COUNT_LIMIT': current_app.config['SMS_CHAR_COUNT_LIMIT'],
'SMS_CHAR_COUNT_LIMIT': SMS_CHAR_COUNT_LIMIT,
'current_service': current_service,
# used to trigger CSV specific err msg content, so not needed for single notification errors.

View File

@@ -47,7 +47,8 @@
{% for message_length, charge in [
('Up to 160 characters', '1 text message'),
('Up to 306 characters', '2 text messages'),
('Up to 459 characters', '3 text messages')
('Up to 459 characters', '3 text messages'),
('Up to 612 characters', '4 text messages'),
] %}
{% call row() %}
{{ text_field(message_length) }}