Fix typo in prior_cases reference and streamline relationship validation in collection_case_priors

This commit is contained in:
Ross
2025-09-15 12:01:12 +01:00
parent 32b246b5ad
commit 85216b36b0
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -2159,16 +2159,16 @@ def collection_case_priors(request, exam_id, case_id):
p.delete()
return HttpResponse(f"Case removed")
elif "prior_case_id" in request.POST:
if not request.POST["relation"]:
return HttpResponse(
"You need to enter text to describe the relationship between the cases"
)
prior_case = Case.objects.get(pk=request.POST["prior_case_id"])
p, created = CasePrior.objects.get_or_create(
case_detail=case_detail, prior_case=prior_case
)
p.relation_text = request.POST["relation"]
if not p.relation_text:
return HttpResponse(
"You need to enter text to describe the relationship between the cases"
)
p.prior_visibility = request.POST["prior_visibility"]
p.save()