Skip to content

Commit a839980

Browse files
committed
Benign lumps: update validation error message wording
1 parent 398a25c commit a839980

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

manage_breast_screening/mammograms/forms/benign_lump_history_item_form.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,18 @@ class BenignLumpHistoryItemForm(FormWithConditionalFields):
2727
label_classes="nhsuk-fieldset__legend--s",
2828
choices=BenignLumpHistoryItem.Procedure,
2929
exclusive_choices={"NO_PROCEDURES"},
30+
error_messages={
31+
"required": "Select which procedures they have had in the left breast",
32+
},
3033
)
3134
right_breast_procedures = MultipleChoiceField(
3235
label="Right breast",
3336
label_classes="nhsuk-fieldset__legend--s",
3437
choices=BenignLumpHistoryItem.Procedure,
3538
exclusive_choices={"NO_PROCEDURES"},
39+
error_messages={
40+
"required": "Select which procedures they have had in the right breast",
41+
},
3642
)
3743

3844
procedure_year = YearField(
@@ -46,6 +52,9 @@ class BenignLumpHistoryItemForm(FormWithConditionalFields):
4652
procedure_location = ChoiceField(
4753
label="Where were the tests and treatment done?",
4854
choices=BenignLumpHistoryItem.ProcedureLocation,
55+
error_messages={
56+
"required": "Select where the tests and treatment were done",
57+
},
4958
)
5059
nhs_hospital_details = CharField(label="Provide details", required=False)
5160
private_clinic_uk_details = CharField(label="Provide details", required=False)
@@ -69,11 +78,11 @@ def __init__(self, *args, **kwargs):
6978
detail_field
7079
)
7180

72-
def create(self, request):
81+
def create(self, appointment, request):
7382
auditor = Auditor.from_request(request)
7483

7584
benign_lump_history_item = BenignLumpHistoryItem.objects.create(
76-
appointment=self.appointment,
85+
appointment=appointment,
7786
left_breast_procedures=self.cleaned_data.get("left_breast_procedures", []),
7887
right_breast_procedures=self.cleaned_data.get(
7988
"right_breast_procedures", []

0 commit comments

Comments
 (0)