Skip to content

Commit

Permalink
Use dict.get('blah') instead of dict.get('blah', None)
Browse files Browse the repository at this point in the history
  • Loading branch information
scottbarnes committed Feb 13, 2024
1 parent faa5fe9 commit 5bfcf0d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion openlibrary/plugins/upstream/mybooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ def add_read_statuses(username, works):
results_map[f"OL{result['work_id']}W"] = result['bookshelf_id']
for work in works:
work_olid = work.key.split('/')[-1]
work['readinglog'] = results_map.get(work_olid, None)
work['readinglog'] = results_map.get(work_olid)
return works


Expand Down
2 changes: 1 addition & 1 deletion scripts/affiliate_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def is_book_needed(book: dict, edition: dict) -> list[str]:

if needed_book_fields: # Log book fields that should to be copied to the edition
fields = ", ".join(needed_book_fields)
logger.debug(f"{edition.get('key', None) or 'New Edition'} needs {fields}")
logger.debug(f"{edition.get('key') or 'New Edition'} needs {fields}")
return needed_book_fields


Expand Down

0 comments on commit 5bfcf0d

Please sign in to comment.