Skip to content

Commit dd9f63e

Browse files
committed
tidy
1 parent 84004b6 commit dd9f63e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

backend/src/constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ class Urls:
2323

2424

2525
GENERIC_SERVER_ERROR_DIAGNOSTICS_MESSAGE = "Unable to process request. Issue may be transient."
26+
27+
VACCINE_TYPE_TO_DISEASES_HASH_KEY = "vacc_to_diseases"

backend/src/parameter_parser.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from clients import redis_client
1010
from models.errors import ParameterException
11+
from constants import VACCINE_TYPE_TO_DISEASES_HASH_KEY
1112

1213
ParamValue = list[str]
1314
ParamContainer = dict[str, ParamValue]
@@ -108,7 +109,7 @@ def process_search_params(params: ParamContainer) -> SearchParams:
108109
if len(vaccine_types) < 1:
109110
raise ParameterException(f"Search parameter {immunization_target_key} must have one or more values.")
110111

111-
valid_vaccine_types = redis_client.hkeys("vacc_to_diseases")
112+
valid_vaccine_types = redis_client.hkeys(VACCINE_TYPE_TO_DISEASES_HASH_KEY)
112113
if any([x not in valid_vaccine_types for x in vaccine_types]):
113114
raise ParameterException(
114115
f"immunization-target must be one or more of the following: {', '.join(valid_vaccine_types)}")

0 commit comments

Comments
 (0)