Merge branch 'master' into edition-task

This commit is contained in:
Mouse Reeve
2020-04-01 22:11:43 -07:00
28 changed files with 547 additions and 390 deletions

View File

@@ -163,6 +163,10 @@ def handle_import_books(user, items):
identifier=item.shelf,
user=user
)
if isinstance(item.book, models.Work):
item.book = item.book.default_edition
if not item.book:
continue
_, created = models.ShelfBook.objects.get_or_create(
book=item.book, shelf=desired_shelf, added_by=user)
if created:
@@ -201,10 +205,10 @@ def handle_review(user, book, name, content, rating):
broadcast(user, article_create_activity, other_recipients)
def handle_comment(user, book, name, content):
def handle_comment(user, book, content):
''' post a review '''
# validated and saves the review in the database so it has an id
comment = create_comment(user, book, name, content)
comment = create_comment(user, book, content)
comment_activity = activitypub.get_comment(comment)
comment_create_activity = activitypub.get_create(user, comment_activity)