Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(backend): rb and dep filter errors #87

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions backend/gn_module_zh/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,11 @@ def filter_area_size(query, json: dict):


def filter_area(query, json: dict, type_code: str):
codes = [area.get("code", None) for area in json]
if type_code == "COM":
codes = [area.get("code", None) for area in json]
else:
codes = json["code"].split()

if any(code is None for code in codes):
return query

Expand Down Expand Up @@ -193,9 +197,8 @@ def filter_hydro(query, json):
return query


def filter_basin(query, basin):
code = basin.get("code", None)

def filter_basin(query, json):
code = json["code"]
if code is not None:
subquery = (
select(
Expand Down
Loading