Skip to content

Commit

Permalink
fix: point to correct model location
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieu-roudaut-crea committed Jun 7, 2024
1 parent aa1fa0a commit df3cbe4
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions backend/gn_module_monitoring/monitoring/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

from geonature.core.gn_permissions.tools import get_scopes_by_action
from pypnnomenclature.models import TNomenclatures
from geonature.core.gn_monitoring.models import BibTypeSite
import gn_module_monitoring.monitoring.models as Models


Expand Down Expand Up @@ -128,7 +129,7 @@ def filter_by_params(cls, query: Select, params: MultiDict = None, **kwargs):
if not isinstance(value, list):
value = [value]
query = query.filter(
cls.types_site.any(Models.BibTypeSite.id_nomenclature_type_site.in_(value))
cls.types_site.any(BibTypeSite.id_nomenclature_type_site.in_(value))
)

query = super().filter_by_params(query, params)
Expand All @@ -149,9 +150,7 @@ def filter_by_specific(
# Get specific
specific_config_models = (
db.session.scalars(
select(Models.BibTypeSite).where(
Models.BibTypeSite.id_nomenclature_type_site.in_(id_types_site)
)
select(BibTypeSite).where(BibTypeSite.id_nomenclature_type_site.in_(id_types_site))
)
.unique()
.all()
Expand Down Expand Up @@ -270,9 +269,7 @@ def filter_by_params(cls, query: Select, params: MultiDict = None, **kwargs):
query = query.join(join_sites, cls.sites)

query = query.filter(
join_sites.types_site.any(
Models.BibTypeSite.id_nomenclature_type_site.in_(value)
)
join_sites.types_site.any(BibTypeSite.id_nomenclature_type_site.in_(value))
)
return query

Expand Down

0 comments on commit df3cbe4

Please sign in to comment.