Skip to content

Commit

Permalink
legacy: relax data handling to avoid errors
Browse files Browse the repository at this point in the history
* Handles error when an affiliation didn't have a name.
  • Loading branch information
lnielsen committed Oct 16, 2023
1 parent 9838474 commit df89283
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion site/zenodo_rdm/legacy/serializers/schemas/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class CreatorSchema(Schema):
def dump_affiliation(self, obj):
"""Dump affiliation."""
if obj.get("affiliations"):
return obj["affiliations"][0]["name"]
return obj["affiliations"][0].get("name")

@post_dump(pass_original=True)
def dump_identifiers(self, result, original, **kwargs):
Expand Down

0 comments on commit df89283

Please sign in to comment.