diff --git a/backend/geonature/core/gn_synthese/routes.py b/backend/geonature/core/gn_synthese/routes.py index 6ef882d551..f871f090e3 100644 --- a/backend/geonature/core/gn_synthese/routes.py +++ b/backend/geonature/core/gn_synthese/routes.py @@ -988,9 +988,8 @@ def taxon_stats(scope, cd_nom): # Subquery to fetch areas based on area_type areas_subquery = ( - select([LAreas.id_area]) - .where(LAreas.id_type == BibAreasTypes.id_type) - .where(BibAreasTypes.type_code == area_type) + select(LAreas.id_area) + .where(LAreas.id_type == BibAreasTypes.id_type, BibAreasTypes.type_code == area_type) .alias("areas") ) cd_ref = db.session.scalar(select(Taxref.cd_ref).where(Taxref.cd_nom == cd_nom))