mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-27 12:01:14 +00:00
Formatting for ratings without reviews.
This commit is contained in:
parent
b5a5a63e88
commit
5edef615c8
1 changed files with 6 additions and 1 deletions
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue