From 9780879ce64f2976e7525f6321eec1a33b496c2b Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Fri, 30 Oct 2020 12:07:22 -0700 Subject: [PATCH] Still shelve books in no-reviews import mode --- bookwyrm/goodreads_import.py | 6 +++--- bookwyrm/outgoing.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bookwyrm/goodreads_import.py b/bookwyrm/goodreads_import.py index 9e2bcd1d..fe5ac56e 100644 --- a/bookwyrm/goodreads_import.py +++ b/bookwyrm/goodreads_import.py @@ -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() diff --git a/bookwyrm/outgoing.py b/bookwyrm/outgoing.py index 2ff8c9fa..908f3b5b 100644 --- a/bookwyrm/outgoing.py +++ b/bookwyrm/outgoing.py @@ -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 ''