diff --git a/bookwyrm/goodreads_import.py b/bookwyrm/goodreads_import.py index 9e2bcd1dc..fe5ac56e2 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 2ff8c9fa6..908f3b5bf 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 ''