Skip to content

Commit 8964c9e

Browse files
committed
Remove full stops from validation error messages
1 parent a27206b commit 8964c9e

21 files changed

+45
-42
lines changed

lung_cancer_screening/nhsuk_forms/choice_field.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ class ChoiceField(forms.ChoiceField):
5656

5757
widget = widgets.RadioSelect
5858
bound_field_class = BoundChoiceField
59+
default_error_messages = {
60+
'invalid': 'Please enter a valid email (e.g., [email protected]).' # Reusable custom message
61+
}
5962

6063
def __init__(
6164
self,

lung_cancer_screening/nhsuk_forms/imperial_height_form.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ def __init__(self, *args, **kwargs):
4747

4848
feet_kwargs = {
4949
"error_messages": {
50-
'invalid': 'Feet must be in whole numbers.',
50+
'invalid': 'Feet must be in whole numbers',
5151
**error_messages,
5252
},
5353
}
5454
inches_kwargs = {
5555
"error_messages": {
56-
'invalid': 'Inches must be in whole numbers.',
56+
'invalid': 'Inches must be in whole numbers',
5757
**error_messages,
5858
},
5959
}

lung_cancer_screening/nhsuk_forms/imperial_weight_form.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,19 @@ def __init__(self, *args, **kwargs):
4848
"min_value": 0,
4949
"max_value": 50,
5050
"error_messages": {
51-
'invalid': 'Stone must be in whole numbers.',
52-
'min_value': 'Weight must be between 4 stone and 50 stone.',
53-
'max_value': 'Weight must be between 4 stone and 50 stone.',
51+
'invalid': 'Stone must be in whole numbers',
52+
'min_value': 'Weight must be between 4 stone and 50 stone',
53+
'max_value': 'Weight must be between 4 stone and 50 stone',
5454
**error_messages,
5555
},
5656
}
5757
pounds_kwargs = {
5858
"min_value": 0,
5959
"max_value": 13,
6060
"error_messages": {
61-
'invalid': 'Pounds must be in whole numbers.',
62-
'min_value': 'Pounds must be between 0 and 13.',
63-
'max_value': 'Pounds must be between 0 and 13.',
61+
'invalid': 'Pounds must be in whole numbers',
62+
'min_value': 'Pounds must be between 0 and 13',
63+
'max_value': 'Pounds must be between 0 and 13',
6464
**error_messages,
6565
},
6666
}

lung_cancer_screening/questions/forms/asbestos_exposure_form.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def __init__(self, *args, **kwargs):
1616
label_classes="nhsuk-fieldset__legend--m",
1717
coerce=lambda x: x == 'True',
1818
error_messages={
19-
'required': 'Select if you have been exposed to asbestos.'
19+
'required': 'Select if you have been exposed to asbestos'
2020
}
2121
)
2222

lung_cancer_screening/questions/forms/date_of_birth_form.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ def __init__(self, *args, **kwargs):
1818
label_is_page_heading=True,
1919
hint="For example, 15 3 1965",
2020
error_messages={
21-
'required': 'Enter your date of birth.',
22-
'incomplete': 'Enter your full date of birth.',
23-
'invalid': 'Date of birth must be a real date.'
21+
'required': 'Enter your date of birth',
22+
'incomplete': 'Enter your full date of birth',
23+
'invalid': 'Date of birth must be a real date'
2424
}
2525
)
2626

lung_cancer_screening/questions/forms/ethnicity_form.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def __init__(self, *args, **kwargs):
1818
label_is_page_heading=True,
1919
hint="Your ethnicity may impact your chances of developing lung cancer.",
2020
error_messages={
21-
'required': 'Select your ethnic background.'
21+
'required': 'Select your ethnic background'
2222
}
2323
)
2424

lung_cancer_screening/questions/forms/gender_form.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def __init__(self, *args, **kwargs):
1818
label_is_page_heading=True,
1919
hint="This information is used to find your NHS number and match with your GP record.",
2020
error_messages={
21-
'required': 'Select the option that best describes your gender.'
21+
'required': 'Select the option that best describes your gender'
2222
}
2323
)
2424

lung_cancer_screening/questions/forms/imperial_height_form.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ def __init__(self, *args, **kwargs):
1515
required=True,
1616
require_all_fields=False,
1717
error_messages={
18-
'required': 'Enter your height.',
19-
'incomplete': 'Enter your height.'
18+
'required': 'Enter your height',
19+
'incomplete': 'Enter your height'
2020
}
2121
)
2222

lung_cancer_screening/questions/forms/imperial_weight_form.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ def __init__(self, *args, **kwargs):
1515
required=True,
1616
require_all_fields=False,
1717
error_messages={
18-
'required': 'Enter your weight.',
19-
'incomplete': 'Enter your weight.'
18+
'required': 'Enter your weight',
19+
'incomplete': 'Enter your weight'
2020
}
2121
)
2222

lung_cancer_screening/questions/forms/metric_height_form.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def __init__(self, *args, **kwargs):
1414
label="Centimetres",
1515
classes="nhsuk-input--width-4",
1616
error_messages={
17-
'required': 'Enter your height.',
17+
'required': 'Enter your height',
1818
}
1919
)
2020

0 commit comments

Comments
 (0)