~netlandish/django-wiki

040d10a8239852bffe3ef6e65a8be16fc9d1ceca — Benjamin Bach 6 years ago b37e0ad + e7533c5
Merge pull request #931 from oleast/fix/username-article-cache

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.