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 | 54537c9b36ef15dd458a419a4d0ef947573f2676 (patch) | |
| tree | b02128e401468d905459587852d15c6b7216d8d0 /archaeological_files/models.py | |
| parent | 15be527b85dd4060a2728f3eff7f461450a3d53e (diff) | |
| download | Ishtar-54537c9b36ef15dd458a419a4d0ef947573f2676.tar.bz2 Ishtar-54537c9b36ef15dd458a419a4d0ef947573f2676.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  | 
