Fix typo in prior_cases reference and streamline relationship validation in collection_case_priors
This commit is contained in:
+4
-4
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user