summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-08-08 13:24:30 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-08-13 18:26:03 +0200
commit15e4d32a3220f0f0f4de43f0217b893da862cc4a (patch)
treecf0c5f77f7b626d51ff492963bb805461491a355 /ishtar_common
parentfeb3e70384b7c3468a35300274a015592528559b (diff)
downloadIshtar-15e4d32a3220f0f0f4de43f0217b893da862cc4a.tar.bz2
Ishtar-15e4d32a3220f0f0f4de43f0217b893da862cc4a.zip
Towns: better management of cached label
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/models.py2
1 files changed, 1 insertions, 1 deletions
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