Render rating status from template

This commit is contained in:
Mouse Reeve
2021-03-13 18:24:35 -08:00
parent a75e4a7404
commit aa2950daf3
2 changed files with 8 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import re
from django.apps import apps
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.template.loader import get_template
from django.utils import timezone
from model_utils.managers import InheritanceManager
@ -309,7 +310,8 @@ class ReviewRating(Review):
@property
def pure_content(self):
return 'Rated "{}": {:d} stars'.format(self.book.title, self.rating)
template = get_template("snippets/generated_status/rating.html")
return template.render({"book": self.book, "rating": self.rating}).strip()
activity_serializer = activitypub.Rating
pure_type = "Note"