Use local key instead of openlibrary key in urls
but uh maybe the local key shouldn't look so gnarly?
This commit is contained in:
parent
5d2fbb8500
commit
0f98610629
13 changed files with 24 additions and 22 deletions
|
@ -8,9 +8,9 @@ from fedireads.connectors.settings import CONNECTORS
|
|||
def get_or_create_book(key):
|
||||
''' pull up a book record by whatever means possible '''
|
||||
try:
|
||||
book = models.Book.objects.get(
|
||||
openlibrary_key=key
|
||||
).select_subclasses()
|
||||
book = models.Book.objects.select_subclasses().get(
|
||||
local_key=key
|
||||
)
|
||||
return book
|
||||
except models.Book.DoesNotExist:
|
||||
pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue