mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-24 09:00:33 +00:00
Fixes small logic errors
This commit is contained in:
parent
9beae9cfcd
commit
c8bb717634
2 changed files with 3 additions and 2 deletions
|
@ -15,6 +15,8 @@ class AbstractConnector(ABC):
|
|||
info = models.Connector.objects.get(identifier=identifier)
|
||||
self.connector = info
|
||||
|
||||
self.book_mappings = {}
|
||||
|
||||
self.base_url = info.base_url
|
||||
self.books_url = info.books_url
|
||||
self.covers_url = info.covers_url
|
||||
|
@ -55,7 +57,6 @@ class AbstractConnector(ABC):
|
|||
def create_book(self, key, data, model):
|
||||
''' create a work or edition from data '''
|
||||
# we really would rather use an existing book than make a new one
|
||||
print(data)
|
||||
match = match_from_mappings(data, self.key_mappings)
|
||||
if match:
|
||||
if not isinstance(match, model):
|
||||
|
@ -78,6 +79,7 @@ class AbstractConnector(ABC):
|
|||
''' simple function to save data to a book '''
|
||||
update_from_mappings(book, data, self.book_mappings)
|
||||
book.save()
|
||||
return book
|
||||
|
||||
|
||||
@abstractmethod
|
||||
|
|
|
@ -73,7 +73,6 @@ class Connector(AbstractConnector):
|
|||
edition.parent_work = work
|
||||
edition.save()
|
||||
|
||||
print(work, edition)
|
||||
return edition
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue