Merge branch 'master' into search-controls
This commit is contained in:
commit
3094e2b539
|
@ -88,7 +88,13 @@ class Connector(AbstractConnector):
|
||||||
edition_data = self.load_book_data(olkey)
|
edition_data = self.load_book_data(olkey)
|
||||||
edition = self.create_book(olkey, edition_data, models.Edition)
|
edition = self.create_book(olkey, edition_data, models.Edition)
|
||||||
|
|
||||||
work_key = edition_data.get('works')[0]['key'].split('/')[-1]
|
work_data = edition_data.get('works')
|
||||||
|
if not work_data:
|
||||||
|
# hack: we're re-using the edition data as the work data
|
||||||
|
work_key = olkey
|
||||||
|
else:
|
||||||
|
work_key = work_data[0]['key'].split('/')[-1]
|
||||||
|
|
||||||
work = models.Work.objects.filter(
|
work = models.Work.objects.filter(
|
||||||
openlibrary_key=work_key
|
openlibrary_key=work_key
|
||||||
).first()
|
).first()
|
||||||
|
|
Loading…
Reference in New Issue