Skip to content

Commit

Permalink
fix(backend): rb and dep filter errors (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienCorny authored Dec 11, 2024
1 parent 44677c1 commit bd4432b
Showing 1 changed file with 7 additions and 4 deletions.
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

0 comments on commit bd4432b

Please sign in to comment.