Skip to content

Commit

Permalink
ICD11: gracefully return None if issues with redis (#2231)
Browse files Browse the repository at this point in the history
Co-authored-by: Vignesh Hari <[email protected]>
  • Loading branch information
rithviknishad and vigneshhari authored Jun 5, 2024
1 parent 7b4fdc8 commit 6b2e808
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions care/facility/static_data/icd11.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

from django.core.paginator import Paginator
from redis_om import Field, Migrator
from redis_om.model.model import NotFoundError as RedisModelNotFoundError

from care.facility.models.icd11_diagnosis import ICD11Diagnosis
from care.utils.static_data.models.base import BaseRedisModel
Expand Down Expand Up @@ -61,7 +60,7 @@ def get_icd11_diagnosis_object_by_id(
try:
diagnosis = ICD11.get(diagnosis_id)
return diagnosis.get_representation() if as_dict else diagnosis
except RedisModelNotFoundError:
except Exception:
return None


Expand Down

0 comments on commit 6b2e808

Please sign in to comment.