Skip to content

Commit

Permalink
fix backend lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrieuclp committed Dec 23, 2024
1 parent 504bb51 commit 98dc948
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backend/geonature/core/gn_meta/models/aframework.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def filter_by_params(cls, params={}, *, _ds_search=True, query=None):
else:
#sinon découpe sur les espaces pour rechercher dans le nom
ands = [];
for term in search.split(' '):
for term in search.split(" "):
if len(term) > 0:
ands.append(func.unaccent(TAcquisitionFramework.acquisition_framework_name).ilike(func.unaccent(f"%{term}%")))
ors = [sa.and_(*ands)]
Expand Down
4 changes: 2 additions & 2 deletions backend/geonature/core/gn_meta/models/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,12 @@ class DatasetFilterSchema(MetadataFilterSchema):
if search.isdigit():
ors = [
func.unaccent(cls.dataset_name).ilike(func.unaccent(f"%{search}%")),
sa.cast(cls.id_dataset, sa.String) == search
sa.cast(cls.id_dataset, sa.String) == search,
]
else:
#sinon découpe sur les espaces pour rechercher dans le nom
ands = [];
for term in search.split(' '):
for term in search.split(" "):
if len(term) > 0:
ands.append(func.unaccent(cls.dataset_name).ilike(func.unaccent(f"%{term}%")))
ors = [sa.and_(*ands)]
Expand Down

0 comments on commit 98dc948

Please sign in to comment.