diff --git a/bookwyrm/models/fields.py b/bookwyrm/models/fields.py
index 247c6aca..a5985e8d 100644
--- a/bookwyrm/models/fields.py
+++ b/bookwyrm/models/fields.py
@@ -448,3 +448,6 @@ class IntegerField(ActivitypubFieldMixin, models.IntegerField):
class DecimalField(ActivitypubFieldMixin, models.DecimalField):
""" activitypub-aware boolean field """
+
+ def field_to_activity(self, value):
+ return float(value)
diff --git a/bookwyrm/models/status.py b/bookwyrm/models/status.py
index 0ddcfd17..56f30020 100644
--- a/bookwyrm/models/status.py
+++ b/bookwyrm/models/status.py
@@ -304,13 +304,12 @@ class Review(Status):
@property
def pure_name(self):
""" clarify review names for mastodon serialization """
- if self.rating:
- return 'Review of "{}" ({:d} stars): {}'.format(
- self.book.title,
- self.rating,
- self.name,
- )
- return 'Review of "{}": {}'.format(self.book.title, self.name)
+ template = get_template("snippets/generated_status/review_pure_name.html")
+ return template.render({
+ "book": self.book,
+ "rating": int(self.rating),
+ "name": self.name
+ }).strip()
@property
def pure_content(self):
@@ -332,7 +331,7 @@ class ReviewRating(Review):
@property
def pure_content(self):
template = get_template("snippets/generated_status/rating.html")
- return template.render({"book": self.book, "rating": self.rating}).strip()
+ return template.render({"book": self.book, "rating": int(self.rating)}).strip()
activity_serializer = activitypub.Rating
pure_type = "Note"
diff --git a/bookwyrm/templates/snippets/generated_status/review_pure_name.html b/bookwyrm/templates/snippets/generated_status/review_pure_name.html
new file mode 100644
index 00000000..3c133678
--- /dev/null
+++ b/bookwyrm/templates/snippets/generated_status/review_pure_name.html
@@ -0,0 +1,10 @@
+{% load i18n %}
+{% if rating %}
+
+{% blocktrans with book_title=book.title rating=rating review_title=name count counter=rating %}Review of {{ book_title }} ({{ rating }} star): {{ review_title }}{% plural %}Review of {{ book_title }} ({{ rating }} stars): {{ review_title }}{% endblocktrans %}
+
+{% else %}
+
+{% blocktrans with book_title=book.title review_title=name %}Review of {{ book_title }}: {{ review_title }}{% endblocktrans %}
+
+{% endif %}