Skip to content

Commit

Permalink
Merge branch 'develop' into user-conf-account-form
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquesfize authored Jan 9, 2024
2 parents 7980588 + 0ca7a3b commit 1c9c635
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
5 changes: 4 additions & 1 deletion backend/geonature/core/gn_synthese/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,10 @@ def general_stats(permissions):
- nb of datasets
"""
nb_allowed_datasets = db.session.scalar(
select(func.count("*")).select_from(TDatasets.select.filter_by_readable())
select(func.count("*"))
.select_from(TDatasets)
.where(TDatasets.filter_by_readable().whereclause)

)
query = select(
func.count(Synthese.id_synthese),
Expand Down
12 changes: 4 additions & 8 deletions backend/geonature/core/sensitivity/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,19 @@ def insert_sensitivity_referential(source, csvfile):
defaults_nomenclatures = {
statut_biologique_nomenclature_type: set(
db.session.scalars(
sa.select(Nomenclature)
.where(
sa.select(Nomenclature).where(
Nomenclature.nomenclature_type == statut_biologique_nomenclature_type,
Nomenclature.mnemonique.in_(["Inconnu", "Non renseigné", "Non Déterminé"]),
)
.all()
)
).all()
),
behaviour_nomenclature_type: set(
db.session.scalars(
sa.select(Nomenclature)
.where(
sa.select(Nomenclature).where(
Nomenclature.nomenclature_type == behaviour_nomenclature_type,
Nomenclature.mnemonique.in_(["NSP", "1"]),
)
.all()
)
).all()
),
}

Expand Down
2 changes: 1 addition & 1 deletion backend/geonature/core/users/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def get_role(id_role):
:param id_role: the id user
:type id_role: int
"""
user = User.query.get_or_404(id_role)
user = DB.get_or_404(User, id_role)
fields = user_fields.copy()
if g.current_user == user:
fields.add("email")
Expand Down

0 comments on commit 1c9c635

Please sign in to comment.