From d3dabdf5e20c5eb79be84ff9818a7dfd46b4945f Mon Sep 17 00:00:00 2001 From: Julian Gautier Date: Sat, 7 May 2022 20:47:42 -0400 Subject: [PATCH] Update dataverse_repository_curation_assistant_functions.py Fixing bug that prevented app from getting metadata of unpublished dataset versions. --- .../dataverse_repository_curation_assistant_functions.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dataverse_repository_curation_assistant/dataverse_repository_curation_assistant_functions.py b/dataverse_repository_curation_assistant/dataverse_repository_curation_assistant_functions.py index ee5d46b..38979d7 100644 --- a/dataverse_repository_curation_assistant/dataverse_repository_curation_assistant_functions.py +++ b/dataverse_repository_curation_assistant/dataverse_repository_curation_assistant_functions.py @@ -907,10 +907,13 @@ def get_metadata_values_lists( datasetPersistentUrl = datasetMetadata['data']['persistentUrl'] datasetPid = get_canonical_pid(datasetPersistentUrl) datasetUrl = installationUrl + '/dataset.xhtml?persistentId=' + datasetPid + if 'versionNumber' in datasetMetadata['data'][versions]: - majorVersionNumber = datasetMetadata['data'][versions]['versionNumber'] - minorVersionNumber = datasetMetadata['data'][versions]['versionMinorNumber'] - datasetVersionNumber = f'{majorVersionNumber}.{minorVersionNumber}' + majorVersionNumber = datasetMetadata['data'][versions]['versionNumber'] + minorVersionNumber = datasetMetadata['data'][versions]['versionMinorNumber'] + datasetVersionNumber = f'{majorVersionNumber}.{minorVersionNumber}' + else: + datasetVersionNumber = 'DRAFT' for fields in datasetMetadata['data'][versions]['metadataBlocks'][metadatablockName]['fields']: if fields['typeName'] == chosenTitleDBName: