From 39b9fe8f4a671bad786e757ea85fd5757184bdc2 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 26 Oct 2020 15:10:32 -0700 Subject: [PATCH] Fixes serializing reviews with no rating --- bookwyrm/models/status.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bookwyrm/models/status.py b/bookwyrm/models/status.py index dfc39194..b1283c9d 100644 --- a/bookwyrm/models/status.py +++ b/bookwyrm/models/status.py @@ -192,9 +192,14 @@ class Review(Status): @property def ap_pure_name(self): ''' clarify review names for mastodon serialization ''' - return 'Review of "%s" (%d stars): %s' % ( + if self.rating: + return 'Review of "%s" (%d stars): %s' % ( + self.book.title, + self.rating, + self.name + ) + return 'Review of "%s": %s' % ( self.book.title, - self.rating, self.name )