Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Commit

Permalink
allow lowercase uri
Browse files Browse the repository at this point in the history
  • Loading branch information
ja573 committed May 31, 2019
1 parent ae8d385 commit 9b75f81
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def save(self):
db.query(q, dict(work_id=self.UUID, title=title))

for i in self.URI:
uri = i['URI'] or i['uri']
uri = i.get('URI') or i.get('uri')
is_canonical = i['canonical']
scheme, value = Identifier.split_uri(uri)
Identifier.insert_if_not_exist(scheme, value)
Expand Down Expand Up @@ -120,7 +120,7 @@ def exists(self):

def delete_uris(self):
for i in self.URI:
uri = i['URI'] or i['uri']
uri = i.get('URI') or i.get('uri')
scheme, value = Identifier.split_uri(uri)
q = '''DELETE FROM work_uri WHERE work_id = $work_id
AND uri_scheme = $scheme AND uri_value = $value'''
Expand Down
2 changes: 1 addition & 1 deletion src/worksctrl.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def POST(self, name):
for i in uris:
# attempt to get scheme from URI
try:
ident = i['URI'] or i['uri']
ident = i.get('URI') or i.get('uri')
scheme, value = Identifier.split_uri(ident)
try:
i['canonical'] = i['canonical'] in (True, "true", "True")
Expand Down

0 comments on commit 9b75f81

Please sign in to comment.