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): def get_review_article(review):
''' a book review formatted for a non-fedireads isntance (mastodon) ''' ''' a book review formatted for a non-fedireads isntance (mastodon) '''
status = get_status(review) status = get_status(review)
if review.rating: if review.rating and review.name:
name = 'Review of "%s" (%d stars): %s' % ( name = 'Review of "%s" (%d stars): %s' % (
review.book.title, review.book.title,
review.rating, review.rating,
review.name review.name
) )
elif review.rating:
name = 'Rated "%s" (%d stars)' % (
review.book.title,
review.rating,
)
else: else:
name = 'Review of "%s": %s' % ( name = 'Review of "%s": %s' % (
review.book.title, review.book.title,