Skip to content

Commit e108f3f

Browse files
committed
Use get_object_or_404 in RecordMedicalInformation view
1 parent e0aaeed commit e108f3f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • manage_breast_screening/record_a_mammogram

manage_breast_screening/record_a_mammogram/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ class RecordMedicalInformation(BaseAppointmentForm):
157157
def get_context_data(self, **kwargs):
158158
context = super().get_context_data(**kwargs)
159159
id = self.kwargs["id"]
160-
participant = Participant.objects.get(screeningepisode__appointment__id=id)
160+
participant = get_object_or_404(Participant, screeningepisode__appointment__id=id)
161161
context.update(
162162
{
163163
"title": "Record medical information",

0 commit comments

Comments
 (0)