summaryrefslogtreecommitdiff
path: root/archaeological_operations/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_operations/models.py')
-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