Skip to content

Commit

Permalink
fix: restore cd_ref filter for /species_observer route
Browse files Browse the repository at this point in the history
  • Loading branch information
edelclaux committed Sep 26, 2024
1 parent 913306c commit 4d5eeb7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions backend/geonature/core/gn_synthese/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@ def species_observers(scope, cd_ref):
per_page = int(request.args.get("per_page", 1))
page = request.args.get("page", 1, int)

Check warning on line 1027 in backend/geonature/core/gn_synthese/routes.py

View check run for this annotation

Codecov / codecov/patch

backend/geonature/core/gn_synthese/routes.py#L1026-L1027

Added lines #L1026 - L1027 were not covered by tests

# taxref_cd_nom_list = SpeciesSheetUtils.get_cd_nom_list_from_cd_ref(cd_ref)
taxref_cd_nom_list = SpeciesSheetUtils.get_cd_nom_list_from_cd_ref(cd_ref)
query = (

Check warning on line 1030 in backend/geonature/core/gn_synthese/routes.py

View check run for this annotation

Codecov / codecov/patch

backend/geonature/core/gn_synthese/routes.py#L1029-L1030

Added lines #L1029 - L1030 were not covered by tests
db.session.query(
func.trim(func.unnest(func.string_to_array(Synthese.observers, ","))).label(
Expand All @@ -1035,8 +1035,9 @@ def species_observers(scope, cd_ref):
func.min(Synthese.date_min).label("date_min"),
func.max(Synthese.date_max).label("date_max"),
func.count(Synthese.observers).label("count"),
).group_by("observer")
# .where(Synthese.cd_nom.in_(taxref_cd_nom_list))
)
.group_by("observer")
.where(Synthese.cd_nom.in_(taxref_cd_nom_list))
)
query = SpeciesSheetUtils.get_synthese_query_with_scope(g.current_user, scope, query)

Check warning on line 1042 in backend/geonature/core/gn_synthese/routes.py

View check run for this annotation

Codecov / codecov/patch

backend/geonature/core/gn_synthese/routes.py#L1042

Added line #L1042 was not covered by tests

Expand Down

0 comments on commit 4d5eeb7

Please sign in to comment.