mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-08 20:53:11 -04:00
Merge pull request #2233 from alphagov/increase-sms-length
Increase SMS maximum length from 459 to 612
This commit is contained in:
@@ -51,8 +51,6 @@ class Config(object):
|
|||||||
SESSION_COOKIE_SECURE = True
|
SESSION_COOKIE_SECURE = True
|
||||||
SESSION_REFRESH_EACH_REQUEST = True
|
SESSION_REFRESH_EACH_REQUEST = True
|
||||||
SHOW_STYLEGUIDE = True
|
SHOW_STYLEGUIDE = True
|
||||||
# TODO: move to utils
|
|
||||||
SMS_CHAR_COUNT_LIMIT = 459
|
|
||||||
WTF_CSRF_ENABLED = True
|
WTF_CSRF_ENABLED = True
|
||||||
WTF_CSRF_TIME_LIMIT = None
|
WTF_CSRF_TIME_LIMIT = None
|
||||||
CSV_UPLOAD_BUCKET_NAME = 'local-notifications-csv-upload'
|
CSV_UPLOAD_BUCKET_NAME = 'local-notifications-csv-upload'
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ from flask import (
|
|||||||
)
|
)
|
||||||
from flask_login import current_user, login_required
|
from flask_login import current_user, login_required
|
||||||
from notifications_python_client.errors import HTTPError
|
from notifications_python_client.errors import HTTPError
|
||||||
|
from notifications_utils import SMS_CHAR_COUNT_LIMIT
|
||||||
from notifications_utils.columns import Columns
|
from notifications_utils.columns import Columns
|
||||||
from notifications_utils.recipients import (
|
from notifications_utils.recipients import (
|
||||||
RecipientCSV,
|
RecipientCSV,
|
||||||
@@ -852,7 +853,7 @@ def get_template_error_dict(exception):
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
'error': error,
|
'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,
|
'current_service': current_service,
|
||||||
|
|
||||||
# used to trigger CSV specific err msg content, so not needed for single notification errors.
|
# used to trigger CSV specific err msg content, so not needed for single notification errors.
|
||||||
|
|||||||
@@ -47,7 +47,8 @@
|
|||||||
{% for message_length, charge in [
|
{% for message_length, charge in [
|
||||||
('Up to 160 characters', '1 text message'),
|
('Up to 160 characters', '1 text message'),
|
||||||
('Up to 306 characters', '2 text messages'),
|
('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() %}
|
{% call row() %}
|
||||||
{{ text_field(message_length) }}
|
{{ text_field(message_length) }}
|
||||||
|
|||||||
@@ -21,4 +21,4 @@ notifications-python-client==5.0.0
|
|||||||
# PaaS
|
# PaaS
|
||||||
awscli-cwlogs>=1.4,<1.5
|
awscli-cwlogs>=1.4,<1.5
|
||||||
|
|
||||||
git+https://github.com/alphagov/notifications-utils.git@30.0.1#egg=notifications-utils==30.0.1
|
git+https://github.com/alphagov/notifications-utils.git@30.1.0#egg=notifications-utils==30.1.0
|
||||||
|
|||||||
@@ -23,13 +23,13 @@ notifications-python-client==5.0.0
|
|||||||
# PaaS
|
# PaaS
|
||||||
awscli-cwlogs>=1.4,<1.5
|
awscli-cwlogs>=1.4,<1.5
|
||||||
|
|
||||||
git+https://github.com/alphagov/notifications-utils.git@30.0.1#egg=notifications-utils==30.0.1
|
git+https://github.com/alphagov/notifications-utils.git@30.1.0#egg=notifications-utils==30.1.0
|
||||||
|
|
||||||
## The following requirements were added by pip freeze:
|
## The following requirements were added by pip freeze:
|
||||||
awscli==1.15.78
|
awscli==1.15.79
|
||||||
bleach==2.1.3
|
bleach==2.1.3
|
||||||
boto3==1.6.16
|
boto3==1.6.16
|
||||||
botocore==1.10.77
|
botocore==1.10.78
|
||||||
certifi==2018.8.13
|
certifi==2018.8.13
|
||||||
chardet==3.0.4
|
chardet==3.0.4
|
||||||
click==6.7
|
click==6.7
|
||||||
|
|||||||
@@ -2916,7 +2916,7 @@ TRIAL_MODE_MSG = (
|
|||||||
'Can’t send to this recipient when service is in trial mode – '
|
'Can’t send to this recipient when service is in trial mode – '
|
||||||
'see https://www.notifications.service.gov.uk/trial-mode'
|
'see https://www.notifications.service.gov.uk/trial-mode'
|
||||||
)
|
)
|
||||||
TOO_LONG_MSG = 'Content for template has a character count greater than the limit of 495'
|
TOO_LONG_MSG = 'Content for template has a character count greater than the limit of 612'
|
||||||
SERVICE_DAILY_LIMIT_MSG = 'Exceeded send limits (1000) for today'
|
SERVICE_DAILY_LIMIT_MSG = 'Exceeded send limits (1000) for today'
|
||||||
|
|
||||||
|
|
||||||
@@ -2929,7 +2929,7 @@ SERVICE_DAILY_LIMIT_MSG = 'Exceeded send limits (1000) for today'
|
|||||||
(
|
(
|
||||||
TOO_LONG_MSG,
|
TOO_LONG_MSG,
|
||||||
'Message too long',
|
'Message too long',
|
||||||
'Text messages can’t be longer than 459 characters. Your message is 554 characters.'
|
'Text messages can’t be longer than 612 characters. Your message is 654 characters.'
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
SERVICE_DAILY_LIMIT_MSG,
|
SERVICE_DAILY_LIMIT_MSG,
|
||||||
@@ -2957,7 +2957,7 @@ def test_send_notification_shows_error_if_400(
|
|||||||
)
|
)
|
||||||
with client_request.session_transaction() as session:
|
with client_request.session_transaction() as session:
|
||||||
session['recipient'] = '07700900001'
|
session['recipient'] = '07700900001'
|
||||||
session['placeholders'] = {'name': 'a' * 500}
|
session['placeholders'] = {'name': 'a' * 600}
|
||||||
|
|
||||||
page = client_request.post(
|
page = client_request.post(
|
||||||
'main.send_notification',
|
'main.send_notification',
|
||||||
|
|||||||
Reference in New Issue
Block a user