Skip to content

Commit

Permalink
Move RESOLUTION_ACCURACY_VALUES to backend_constants.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ziv17 committed May 6, 2024
1 parent fef1db0 commit b26f4b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
7 changes: 7 additions & 0 deletions anyway/backend_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
10 changes: 1 addition & 9 deletions anyway/widgets/widget_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit b26f4b2

Please sign in to comment.