From 1dc153202c6904f42f30aab20222e49ec7e609f2 Mon Sep 17 00:00:00 2001 From: Andria Capai Date: Fri, 8 Mar 2024 19:33:04 +0100 Subject: [PATCH] fix(test): WIP - error based on id_nomenclature Error message : raise sa_exc.InvalidRequestError( sqlalchemy.exc.InvalidRequestError: 'TDatasets.nomenclature_data_origin' is not available due to lazy='raise' See: FIXME of this commit Reviewed-by: andriacap --- backend/geonature/core/gn_synthese/imports/__init__.py | 2 ++ .../6e1852ecfea2_add_column_unique_dataset_id_to_t_.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/geonature/core/gn_synthese/imports/__init__.py b/backend/geonature/core/gn_synthese/imports/__init__.py index eccdcb1353..d9ced0b32b 100644 --- a/backend/geonature/core/gn_synthese/imports/__init__.py +++ b/backend/geonature/core/gn_synthese/imports/__init__.py @@ -205,6 +205,8 @@ def update_batch_progress(batch, step): if ( current_app.config["IMPORT"]["CHECK_PRIVATE_JDD_BLURING"] # and not current_app.config["IMPORT"]["FILL_MISSING_NOMENCLATURE_WITH_DEFAULT_VALUE"] # XXX + # FIXME: raise sa_exc.InvalidRequestError( + # sqlalchemy.exc.InvalidRequestError: 'TDatasets.nomenclature_data_origin' is not available due to lazy='raise' and imprt.dataset.nomenclature_data_origin.mnemonique == "Privée" ): check_nomenclature_blurring(imprt, entity, fields["id_nomenclature_blurring"]) diff --git a/backend/geonature/migrations/versions/imports/6e1852ecfea2_add_column_unique_dataset_id_to_t_.py b/backend/geonature/migrations/versions/imports/6e1852ecfea2_add_column_unique_dataset_id_to_t_.py index aaba6d4eb5..d840d01d52 100644 --- a/backend/geonature/migrations/versions/imports/6e1852ecfea2_add_column_unique_dataset_id_to_t_.py +++ b/backend/geonature/migrations/versions/imports/6e1852ecfea2_add_column_unique_dataset_id_to_t_.py @@ -1,7 +1,7 @@ """add column unique_dataset_id to t_imports_synthese and insert into bib_fields and cor_entity_field Revision ID: 6e1852ecfea2 -Revises: bfc90691737d +Revises: fe3d0b49ee14 Create Date: 2024-03-04 12:31:00.861460 """ @@ -13,7 +13,7 @@ # revision identifiers, used by Alembic. revision = "6e1852ecfea2" -down_revision = "bfc90691737d" +down_revision = "fe3d0b49ee14" branch_labels = None depends_on = None