summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2014-02-14 11:32:34 +0100
committerÉtienne Loks <etienne.loks@peacefrogs.net>2014-02-14 11:32:34 +0100
commit9059440b742da4659475b27c0ae08bbac6fa15c9 (patch)
tree81c71d912dcd3add83845fd9c3f1bc93832153c2
parent1a956579f10aeb0ce8ff37a76525881da7ee2277 (diff)
downloadIshtar-9059440b742da4659475b27c0ae08bbac6fa15c9.tar.bz2
Ishtar-9059440b742da4659475b27c0ae08bbac6fa15c9.zip
Fix filename for adminact docs
-rw-r--r--archaeological_operations/models.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py
index c23bda9df..200619abd 100644
--- a/archaeological_operations/models.py
+++ b/archaeological_operations/models.py
@@ -472,12 +472,12 @@ class AdministrativeAct(BaseHistorizedItem, OwnPerms, ValueGetter):
return []
towns_lbl = _(u"Towns")
- def get_filename(self, operation=False):
- filename = ''
- if operation and self.operation:
- filename = self.operation.associated_filename
- elif self.associated_file:
- filename = self.associated_file.associated_filename
+ @property
+ def related_item(self):
+ return self.operation if self.operation else self.associated_file
+
+ def get_filename(self):
+ filename = self.related_item.associated_filename
filename = u"-".join(filename.split('-')[:-1]) # remove date
if self.act_type.code:
filename += u"-" + self.act_type.code