have tasks return bookloader return values
parent
11e75cb0a9
commit
07073f8620
|
@ -97,10 +97,15 @@ def add_related(isbn):
|
|||
# this is the work everything will hang off
|
||||
work = edition.work
|
||||
|
||||
new_editions = []
|
||||
for other_isbn in thingisbn(isbn):
|
||||
related_edition = add_by_isbn(other_isbn, work)
|
||||
if related_edition and related_edition.work != edition.work:
|
||||
merge_works(edition.work, related_edition.work)
|
||||
if related_edition:
|
||||
new_editions.append(related_edition)
|
||||
|
||||
return new_editions
|
||||
|
||||
|
||||
def thingisbn(isbn):
|
||||
|
|
|
@ -4,8 +4,8 @@ from regluit.core import bookloader
|
|||
|
||||
@task
|
||||
def add_related(isbn):
|
||||
bookloader.add_related(isbn)
|
||||
return bookloader.add_related(isbn)
|
||||
|
||||
@task
|
||||
def add_by_isbn(isbn):
|
||||
bookloader.add_by_isbn(isbn)
|
||||
return bookloader.add_by_isbn(isbn)
|
||||
|
|
Loading…
Reference in New Issue