Skip to content

Commit

Permalink
the rights construction I previously identified as being problematic …
Browse files Browse the repository at this point in the history
…started causing problems
  • Loading branch information
mrmiguez committed Nov 15, 2022
1 parent dbb7899 commit 52a2727
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions manatus/scenarios.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,15 +634,23 @@ def creator(self):

@property
def rights(self):
# TODO: this is real ugly and will break if there are no RS.org URIs to return
# TODO: this is real ugly
rights_info = {}
for rights in self.record.metadata.rights:
if rights.uri:
return rights.uri
rights_info['uri'] = rights.uri
else:
if rights.text.startswith('http'):
return rights.text
if rights.text.startswith('http://rightsstatements'):
rights_info['uri'] = rights.text
else:
continue
rights_info['text'] = rights.text
continue
if rights_info['uri']:
return rights_info['uri']
elif rights_info['text']:
return rights_info['text']
else:
return None


class InternetArchiveRecord(ManatusRecord):
Expand Down

0 comments on commit 52a2727

Please sign in to comment.