mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-23 16:40:36 +00:00
Still shelve books in no-reviews import mode
This commit is contained in:
parent
701be26100
commit
9780879ce6
2 changed files with 5 additions and 5 deletions
|
@ -47,9 +47,9 @@ def import_data(job_id):
|
|||
item.save()
|
||||
results.append(item)
|
||||
|
||||
if job.include_reviews:
|
||||
# shelves book and handles reviews
|
||||
outgoing.handle_imported_book(job.user, item, job.privacy)
|
||||
# shelves book and handles reviews
|
||||
outgoing.handle_imported_book(
|
||||
job.user, item, job.include_reviews, job.privacy)
|
||||
else:
|
||||
item.fail_reason = "Could not find a match for book"
|
||||
item.save()
|
||||
|
|
|
@ -155,7 +155,7 @@ def handle_unshelve(user, book, shelf):
|
|||
broadcast(user, activity)
|
||||
|
||||
|
||||
def handle_imported_book(user, item, privacy):
|
||||
def handle_imported_book(user, item, include_reviews, privacy):
|
||||
''' process a goodreads csv and then post about it '''
|
||||
if isinstance(item.book, models.Work):
|
||||
item.book = item.book.default_edition
|
||||
|
@ -179,7 +179,7 @@ def handle_imported_book(user, item, privacy):
|
|||
read.user = user
|
||||
read.save()
|
||||
|
||||
if item.rating or item.review:
|
||||
if include_reviews and (item.rating or item.review):
|
||||
review_title = 'Review of {!r} on Goodreads'.format(
|
||||
item.book.title,
|
||||
) if item.review else ''
|
||||
|
|
Loading…
Reference in a new issue