Formatting for ratings without reviews.

This commit is contained in:
Adam Kelly 2020-04-02 10:38:40 +01:00
parent b5a5a63e88
commit 5edef615c8

View file

@ -25,12 +25,17 @@ def get_comment(comment):
def get_review_article(review):
''' a book review formatted for a non-fedireads isntance (mastodon) '''
status = get_status(review)
if review.rating:
if review.rating and review.name:
name = 'Review of "%s" (%d stars): %s' % (
review.book.title,
review.rating,
review.name
)
elif review.rating:
name = 'Rated "%s" (%d stars)' % (
review.book.title,
review.rating,
)
else:
name = 'Review of "%s": %s' % (
review.book.title,