From 3e4da448ac82f0a3a6ead0041ff3ca1314da6eaf Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 14 Feb 2014 11:32:34 +0100 Subject: Fix filename for adminact docs --- archaeological_operations/models.py | 12 ++++++------ 1 file 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 -- cgit v1.2.3