have tasks return bookloader return values

pull/1/head
Ed Summers 2011-10-20 05:23:30 +00:00
parent 11e75cb0a9
commit 07073f8620
2 changed files with 7 additions and 2 deletions

View File

@ -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):

View File

@ -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)