From b26f4b203895ca6510d409db63a02b05339421d6 Mon Sep 17 00:00:00 2001 From: ziv Date: Mon, 6 May 2024 20:18:58 +0300 Subject: [PATCH] Move RESOLUTION_ACCURACY_VALUES to backend_constants.py --- anyway/backend_constants.py | 7 +++++++ anyway/widgets/widget_utils.py | 10 +--------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/anyway/backend_constants.py b/anyway/backend_constants.py index ef842cb74..3c4b713d9 100644 --- a/anyway/backend_constants.py +++ b/anyway/backend_constants.py @@ -81,6 +81,13 @@ class ResolutionCategories(Enum): ResolutionCategories.SUBURBAN_JUNCTION ] + RESOLUTION_ACCURACY_VALUES: dict = { + ResolutionCategories.SUBURBAN_JUNCTION: [1, 4], + ResolutionCategories.SUBURBAN_ROAD: [1, 4], + ResolutionCategories.URBAN_JUNCTION: [1, 3], + ResolutionCategories.STREET: [1, 3], + } + class Source(Enum): @classmethod def _missing_(cls, value): diff --git a/anyway/widgets/widget_utils.py b/anyway/widgets/widget_utils.py index 6d768c962..0d5046ebd 100644 --- a/anyway/widgets/widget_utils.py +++ b/anyway/widgets/widget_utils.py @@ -338,16 +338,8 @@ def get_location_text(request_params: RequestParams) -> str: return f'{_("in street")} {request_params.location_info["street1_hebrew"]} {in_str}{request_params.location_info["yishuv_name"]}' -__RESOLUTION_ACCURACY_VALUES: dict = { - RC.SUBURBAN_JUNCTION: [1, 4], - RC.SUBURBAN_ROAD: [1, 4], - RC.URBAN_JUNCTION: [1, 3], - RC.STREET: [1, 3], -} - - def get_resolution_location_accuracy_filter(rc: RC) -> Optional[dict]: - vals = __RESOLUTION_ACCURACY_VALUES.get(rc) + vals = BE_CONST.RESOLUTION_ACCURACY_VALUES.get(rc) return {"location_accuracy": vals} if vals else None