Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GN 2.14] Module METADONNÉES : filtres avancés de localisation provoquent une erreur ('where_by_areas') #3250

Open
JeromeMaruejouls opened this issue Nov 7, 2024 · 1 comment
Labels

Comments

@JeromeMaruejouls
Copy link

Version
2.14 (ca fonctionnait en 2.13)

Description du bug
Lorsque l'on fait une recherche avancée dans le module Métadonnées, si l'on sélectionne une zone géographique (commune, département), un message d'erreur apparait. Et dans les logs : AttributeError: 'Select' object has no attribute 'where_by_areas'

Comment reproduire
Le problème apparait également sur l'instance de démo ; faire une recherche geom dans le module métadonnées

Logs

[2024-11-07 15:51:14 +0000] [251616] [ERROR] Exception on /meta/acquisition_frameworks [POST]
Traceback (most recent call last):
  File "/home/geonatureadmin/geonature/backend/venv/lib/python3.11/site-packages/flask/app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/geonatureadmin/geonature/backend/venv/lib/python3.11/site-packages/flask/app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/geonatureadmin/geonature/backend/venv/lib/python3.11/site-packages/flask_login/utils.py", line 290, in decorated_view    return current_app.ensure_sync(func)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/geonatureadmin/geonature/backend/geonature/core/gn_meta/routes.py", line 534, in get_acquisition_frameworks
    af_list = TAcquisitionFramework.filter_by_params(request.json, query=af_list)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/geonatureadmin/geonature/backend/venv/lib/python3.11/site-packages/utils_flask_sqla/models.py", line 87, in _
    result = method(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/geonatureadmin/geonature/backend/geonature/core/gn_meta/models/aframework.py", line 261, in filter_by_params
    ds_filter = TDatasets.filter_by_params(ds_params).whereclause
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/geonatureadmin/geonature/backend/venv/lib/python3.11/site-packages/utils_flask_sqla/models.py", line 87, in _
    result = method(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/geonatureadmin/geonature/backend/geonature/core/gn_meta/models/datasets.py", line 273, in filter_by_params
    query = query.where_by_areas(areas)
            ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Select' object has no attribute 'where_by_areas'

@JeromeMaruejouls JeromeMaruejouls changed the title [GN 2.14] Module METADONNÉES : filtres avancées de localisation provoquent une erreur ('where_by_areas') [GN 2.14] Module METADONNÉES : filtres avancés de localisation provoquent une erreur ('where_by_areas') Nov 7, 2024
@JeromeMaruejouls
Copy link
Author

J'ai trouvé l'erreur, je poste la CR demain !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant