Skip to content

Commit

Permalink
oai: fix error on document type processing
Browse files Browse the repository at this point in the history
* Closes #789.

Co-Authored-by: Bertrand Zuchuat <bertrand.zuchuat@rero.ch>
  • Loading branch information
Garfield-fr committed Feb 24, 2022
1 parent dd07585 commit b89e93c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sonar/modules/documents/serializers/schemas/dc.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,11 @@ def get_titles(self, obj):
def get_types(self, obj):
"""Get types."""
if obj['metadata'].get('documentType'):
type = obj['metadata']['documentType'];
if type.find(':') != -1:
type = type.split(':')[1]
return [
'http://purl.org/coar/resource_type/{type}'.format(
type=obj['metadata']['documentType'].split(':')[1])
'http://purl.org/coar/resource_type/{type}'.format(type=type)
]

return []
Expand Down

0 comments on commit b89e93c

Please sign in to comment.