diff --git a/json_datacite.py b/json_datacite.py index a689ce04b..b1e248a1b 100644 --- a/json_datacite.py +++ b/json_datacite.py @@ -262,14 +262,14 @@ def get_contributors(combi): for person in combi.get('Contributor', []): affiliations = [] for aff in person.get('Affiliation', []): - if isinstance(aff, dict): + if isinstance(aff, dict) and len(aff): if "Affiliation_Identifier" in aff and len(aff["Affiliation_Identifier"]): affiliations.append({"name": aff['Affiliation_Name'], "affiliationIdentifier": '{}'.format(aff['Affiliation_Identifier']), "affiliationIdentifierScheme": "ROR"}) else: affiliations.append({'name': aff['Affiliation_Name']}) - else: + elif len(aff): affiliations.append({'name': aff}) name_ids = [] @@ -293,14 +293,14 @@ def get_contributors(combi): for person in combi.get('ContactPerson', []): affiliations = [] for aff in person.get('Affiliation', []): - if isinstance(aff, dict): + if isinstance(aff, dict) and len(aff): if "Affiliation_Identifier" in aff and len(aff["Affiliation_Identifier"]): affiliations.append({"name": aff['Affiliation_Name'], "affiliationIdentifier": '{}'.format(aff['Affiliation_Identifier']), "affiliationIdentifierScheme": "ROR"}) else: affiliations.append({'name': aff['Affiliation_Name']}) - else: + elif len(aff): affiliations.append({'name': aff}) name_ids = [] @@ -445,7 +445,7 @@ def get_geo_locations(combi): There are two versions of this: 1) Default schema - only textual representation of - 2) Geo schema including map (=bounding box or marker/point information) Inclunding temporal and spatial descriptions + 2) Geo schema including map (=bounding box or marker/point information) Including temporal and spatial descriptions Both are mutually exclusive. I.e. first test presence of 'geoLocation'. Then test presence of 'Covered_Geolocation_Place' diff --git a/meta.py b/meta.py index c76388d97..350c75dbb 100644 --- a/meta.py +++ b/meta.py @@ -395,11 +395,12 @@ def update_index_metadata(ctx, path, metadata, creation_time, data_package): if 'Contributor' in metadata: for contributor in metadata['Contributor']: - name = contributor['Name'] - if 'Given_Name' in name and 'Family_Name' in name: - ctx.msi_add_avu('-C', path, 'Contributor', - name['Given_Name'] + ' ' + name['Family_Name'], - constants.UUFLATINDEX) + if 'Name' in contributor: + name = contributor['Name'] + if 'Given_Name' in name and 'Family_Name' in name: + ctx.msi_add_avu('-C', path, 'Contributor', + name['Given_Name'] + ' ' + name['Family_Name'], + constants.UUFLATINDEX) if 'Tag' in metadata: for tag in metadata['Tag']: diff --git a/publication.py b/publication.py index 3cac0f6b6..02fe50bd2 100644 --- a/publication.py +++ b/publication.py @@ -333,7 +333,7 @@ def generate_base_DOI(ctx, publication_config, publication_state): def generate_datacite_json(ctx, publication_state): - """Generate a DataCite compliant JSON based up yoda-metadata.json. + """Generate a DataCite compliant JSON based on yoda-metadata.json. :param ctx: Combined type of a callback and rei struct :param publication_state: Dict with state of the publication process diff --git a/templates/landingpage.html.j2 b/templates/landingpage.html.j2 index 05cfcd82f..f5b1e1289 100644 --- a/templates/landingpage.html.j2 +++ b/templates/landingpage.html.j2 @@ -445,7 +445,6 @@ {{ contributor.Name.Family_Name }}, {{ contributor.Name.Given_Name }} - {% endif %}