Skip to content

Commit

Permalink
add TODO for better response codes
Browse files Browse the repository at this point in the history
  • Loading branch information
hornc committed Jan 10, 2020
1 parent 43ee8ac commit b58237a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions openlibrary/plugins/importapi/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,13 @@ def POST(self):

try:
reply = add_book.load(edition)
# TODO: If any records have been created, return a 201, otherwise 200
return json.dumps(reply)
except add_book.RequiredField as e:
return self.error('missing-required-field', str(e))
return json.dumps(reply)

def reject_non_book_marc(self, marc_record, **kwargs):
details = "Item rejected"
details = 'Item rejected'
# Is the item a serial instead of a book?
marc_leaders = marc_record.leader()
if marc_leaders[7] == 's':
Expand Down

0 comments on commit b58237a

Please sign in to comment.