forked from mirrors/bookwyrm
Fix create_review_from_activity.
This commit is contained in:
parent
9933dbba54
commit
ae191731dc
1 changed files with 4 additions and 2 deletions
|
@ -8,14 +8,16 @@ from fedireads.sanitize_html import InputHtmlParser
|
|||
|
||||
def create_review_from_activity(author, activity):
|
||||
''' parse an activity json blob into a status '''
|
||||
book = activity['inReplyToBook']
|
||||
book = book.split('/')[-1]
|
||||
book_id = activity['inReplyToBook']
|
||||
book_id = book_id.split('/')[-1]
|
||||
name = activity.get('name')
|
||||
rating = activity.get('rating')
|
||||
content = activity.get('content')
|
||||
published = activity.get('published')
|
||||
remote_id = activity['id']
|
||||
|
||||
book = get_or_create_book(book_id)
|
||||
|
||||
review = create_review(author, book, name, content, rating)
|
||||
review.published_date = published
|
||||
review.remote_id = remote_id
|
||||
|
|
Loading…
Reference in a new issue