diff --git a/backend/geonature/core/gn_meta/mtd/__init__.py b/backend/geonature/core/gn_meta/mtd/__init__.py index fe119862ab..7364c79ced 100644 --- a/backend/geonature/core/gn_meta/mtd/__init__.py +++ b/backend/geonature/core/gn_meta/mtd/__init__.py @@ -215,6 +215,7 @@ def process_af_and_ds(af_list, ds_list, id_role=None): CorAcquisitionFrameworkActor, "id_acquisition_framework", af.id_acquisition_framework, + af.unique_acquisition_framework_id, ) # TODO: remove actors removed from MTD db.session.commit() @@ -231,7 +232,13 @@ def process_af_and_ds(af_list, ds_list, id_role=None): user_add_total_time += time.time() - start_add_user_time ds = sync_ds(ds, list_cd_nomenclature) if ds is not None: - associate_actors(actors, CorDatasetActor, "id_dataset", ds.id_dataset) + associate_actors( + actors, + CorDatasetActor, + "id_dataset", + ds.id_dataset, + ds.unique_dataset_id, + ) user_add_total_time = round(user_add_total_time, 2) db.session.commit() diff --git a/backend/geonature/core/gn_meta/mtd/mtd_utils.py b/backend/geonature/core/gn_meta/mtd/mtd_utils.py index d2fa5f6639..8d92b01252 100644 --- a/backend/geonature/core/gn_meta/mtd/mtd_utils.py +++ b/backend/geonature/core/gn_meta/mtd/mtd_utils.py @@ -219,6 +219,7 @@ def associate_actors( CorActor: Union[CorAcquisitionFrameworkActor, CorDatasetActor], pk_name: Literal["id_acquisition_framework", "id_dataset"], pk_value: str, + uuid_mtd: str, ): """ Associate actors with either a given : @@ -237,6 +238,8 @@ def associate_actors( - 'id_dataset' for DS pk_value : str pk value: ID of the AF or DS + uuid_mtd : str + UUID of the AF or DS """ type_mtd = "AF" if pk_name == "id_acquisition_framework" else "DS" for actor in actors: