diff --git a/app/main/forms.py b/app/main/forms.py index 0ab44e1ff..546bab1a4 100644 --- a/app/main/forms.py +++ b/app/main/forms.py @@ -181,7 +181,7 @@ class ForgivingIntegerField(StringField): if valuelist: - valuelist[0] = valuelist[0].replace(',', '') + valuelist[0] = valuelist[0].replace(',', '').replace(' ', '') try: valuelist[0] = int(valuelist[0]) diff --git a/tests/app/main/views/test_service_settings.py b/tests/app/main/views/test_service_settings.py index 1eb68e16a..82c79827d 100644 --- a/tests/app/main/views/test_service_settings.py +++ b/tests/app/main/views/test_service_settings.py @@ -927,7 +927,7 @@ def test_should_show_persist_estimated_volumes( ), ( { - 'volume_email': '1234', + 'volume_email': '1 234', 'volume_sms': '0', 'volume_letter': '9876', 'consent_to_research': '', @@ -963,7 +963,7 @@ def test_should_error_if_all_volumes_zero( _data={ 'volume_email': '', 'volume_sms': '0', - 'volume_letter': '0,000', + 'volume_letter': '0,00 0', 'consent_to_research': 'yes', }, _expected_status=200,