Skip to content

Commit

Permalink
change error text when diagnosis not detected
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvw committed May 20, 2024
1 parent fa896ae commit eb376e5
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions edc_dx/diagnoses.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
get_initial_review_model_cls,
)

from .utils import get_diagnosis_labels, get_diagnosis_labels_prefixes
from .utils import get_diagnosis_labels


class InitialReviewRequired(Exception):
Expand Down Expand Up @@ -79,13 +79,9 @@ def get_dx_by_model(self, instance) -> str:
dx = self.get_dx(prefix)
break
if not dx:
models_classes = [
get_initial_review_model_cls(prefix)
for prefix in get_diagnosis_labels_prefixes()
]
raise DiagnosesError(
f"Invalid. Expected an instance of one of {models_classes}. "
f"Got {instance.__class__}"
f"Invalid. No diagnoses detected. "
f"See responses on {self.clinical_review_baseline._meta.verbose_name}."
)
return dx

Expand Down

0 comments on commit eb376e5

Please sign in to comment.