From c1f68ff5572e9747c0d8c997ac3f66c8a0655a2b Mon Sep 17 00:00:00 2001 From: Bertrand Bordage Date: Tue, 9 Dec 2014 03:17:09 +0100 Subject: [PATCH] Small fixes in the debug toolbar panel. --- cachalot/panels.py | 3 ++- cachalot/templates/cachalot/panel.html | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cachalot/panels.py b/cachalot/panels.py index 507eb25..4c4c3f8 100644 --- a/cachalot/panels.py +++ b/cachalot/panels.py @@ -54,11 +54,12 @@ class CachalotPanel(Panel): data[db_alias].append( (model._meta.app_label, model.__name__, invalidation)) if self.last_invalidation is None \ - or invalidation < self.last_invalidation: + or invalidation > self.last_invalidation: self.last_invalidation = invalidation data[db_alias].sort(key=lambda row: row[2], reverse=True) self.record_stats({'invalidations_per_db': data.items()}) + @property def nav_subtitle(self): if self.enabled and self.last_invalidation is not None: return (_('Last invalidation: %s') diff --git a/cachalot/templates/cachalot/panel.html b/cachalot/templates/cachalot/panel.html index 27868b6..5066352 100644 --- a/cachalot/templates/cachalot/panel.html +++ b/cachalot/templates/cachalot/panel.html @@ -1,7 +1,7 @@ {% load i18n %} {% for db_alias, invalidations in invalidations_per_db %} -

{% blocktrans %}Database '{{ db_alias }}'{% endblocktrans %}

+

{% blocktrans %}Database '{{ db_alias }}'{% endblocktrans %}