diff --git a/src/datadoc/backend/datadoc_metadata.py b/src/datadoc/backend/datadoc_metadata.py index 31d62f87..b5a1b7dd 100644 --- a/src/datadoc/backend/datadoc_metadata.py +++ b/src/datadoc/backend/datadoc_metadata.py @@ -184,7 +184,7 @@ def extract_metadata_from_dataset( version=dapla_dataset_path_info.dataset_version, contains_data_from=str(dapla_dataset_path_info.contains_data_from), contains_data_until=str(dapla_dataset_path_info.contains_data_until), - data_source_path=self.dataset_path, + file_path=str(self.dataset_path), metadata_created_by=user_info.get_user_info_for_current_platform().short_email, # TODO @mmwinther: Remove multiple_language_support once the model is updated. # https://github.com/statisticsnorway/ssb-datadoc-model/issues/41 diff --git a/src/datadoc/frontend/fields/display_dataset.py b/src/datadoc/frontend/fields/display_dataset.py index 860ecfb0..3d8ae1f3 100644 --- a/src/datadoc/frontend/fields/display_dataset.py +++ b/src/datadoc/frontend/fields/display_dataset.py @@ -256,6 +256,7 @@ class DatasetIdentifiers(str, Enum): description="Filstien inneholder datasettets navn og stien til hvor det er lagret.", obligatory=True, editable=False, + value_getter=get_metadata_and_stringify, ), DatasetIdentifiers.METADATA_CREATED_DATE: MetadataInputField( identifier=DatasetIdentifiers.METADATA_CREATED_DATE.value, diff --git a/tests/backend/test_datadoc_metadata.py b/tests/backend/test_datadoc_metadata.py index 6fb983c7..8db91d7c 100644 --- a/tests/backend/test_datadoc_metadata.py +++ b/tests/backend/test_datadoc_metadata.py @@ -181,6 +181,10 @@ def test_dataset_short_name(metadata: DataDocMetadata): assert metadata.dataset.short_name == "person_data" +def test_dataset_file_path(metadata: DataDocMetadata): + assert metadata.dataset.file_path == str(metadata.dataset_path) + + def test_variable_role_default_value(metadata: DataDocMetadata): assert all( v.variable_role == VariableRole.MEASURE.value for v in metadata.variables