From 15e4d32a3220f0f0f4de43f0217b893da862cc4a Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 8 Aug 2018 13:24:30 +0200 Subject: Towns: better management of cached label --- ishtar_common/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ishtar_common') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 4b663aa23..10939deea 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -3556,7 +3556,7 @@ class Town(Imported, models.Model): cached_label = self.name if settings.COUNTRY == "fr": cached_label = u"%s - %s" % (self.name, self.numero_insee[:2]) - if self.year: + if self.year and self.children.count(): cached_label += " ({})".format(self.year) return cached_label -- cgit v1.2.3