~netlandish/django-wiki

e7533c57535f27e688d102b2b2da5fdd4699ca4a — oleast 6 years ago b37e0ad
Use User.get_username() for article cache instead of User.__str__
1 files changed, 2 insertions(+), 2 deletions(-)

M src/wiki/models/article.py
M src/wiki/models/article.py => src/wiki/models/article.py +2 -2
@@ 207,9 207,9 @@ class Article(models.Model):

    def get_cache_content_key(self, user=None):
        """Returns per-article-user cache key."""
        return "{key}:{user!s}".format(
        return "{key}:{user}".format(
            key=self.get_cache_key(),
            user=user if user else "")
            user=user.get_username() if user else "")

    def get_cached_content(self, user=None):
        """Returns cached version of rendered article.