From e7533c57535f27e688d102b2b2da5fdd4699ca4a Mon Sep 17 00:00:00 2001 From: oleast Date: Thu, 15 Nov 2018 15:37:03 +0100 Subject: [PATCH] Use User.get_username() for article cache instead of User.__str__ --- src/wiki/models/article.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wiki/models/article.py b/src/wiki/models/article.py index a9fa8ae0..393210f1 100644 --- a/src/wiki/models/article.py +++ b/src/wiki/models/article.py @@ -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. -- 2.45.2