diff options
author | Étienne Loks <etienne.loks@proxience.com> | 2014-12-30 18:08:30 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@proxience.com> | 2015-05-06 15:38:32 +0200 |
commit | 52b1abbc54db98ef848eddf41a3c5c58be2e5b3f (patch) | |
tree | b02128e401468d905459587852d15c6b7216d8d0 /archaeological_files/models.py | |
parent | 6242fd2ed8f2df236375f32374a694d886135e58 (diff) | |
download | Ishtar-52b1abbc54db98ef848eddf41a3c5c58be2e5b3f.tar.bz2 Ishtar-52b1abbc54db98ef848eddf41a3c5c58be2e5b3f.zip |
Add a new action to create an associated operation from a file window
Diffstat (limited to 'archaeological_files/models.py')
-rw-r--r-- | archaeological_files/models.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/archaeological_files/models.py b/archaeological_files/models.py index 289aa4166..d8281d591 100644 --- a/archaeological_files/models.py +++ b/archaeological_files/models.py @@ -270,7 +270,9 @@ class File(BaseHistorizedItem, OwnPerms, ValueGetter, ShortMenuItem, def get_town_label(self): lbl = unicode(_('Intercommunal')) - if self.towns.count() == 1: + if self.main_town: + lbl = self.main_town.name + elif self.towns.count() == 1: lbl = self.towns.all()[0].name return lbl |