From caf8ace860d8dd83092dbd7ede29acc022c204e0 Mon Sep 17 00:00:00 2001 From: Richard A Date: Tue, 14 May 2013 14:24:59 +1000 Subject: [PATCH] Updated models.py -> invalidate_cache() A problem occurs with best_match_for_path() if the desired path does not already exist at creation time. On first run, best_match_for_path() will populate the cache with the best possible match. When the user creates the actual desired path however, the cache is never updated as the code only flushes _original_cached_url (which is empty for a new page). This is resolved by *also* flushing _cached_url at the same time. --- feincms/module/page/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/feincms/module/page/models.py b/feincms/module/page/models.py index a15f06689..92a640122 100644 --- a/feincms/module/page/models.py +++ b/feincms/module/page/models.py @@ -287,6 +287,8 @@ def delete(self, *args, **kwargs): def invalidate_cache(self): ck = self.path_to_cache_key(self._original_cached_url) django_cache.delete(ck) + ck = self.path_to_cache_key(self._cached_url) + django_cache.delete(ck) @models.permalink def get_absolute_url(self):