summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-08-01 10:47:58 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-08-01 10:47:58 +0200
commit848232371048386bf0602fbca1375df8f6afbc17 (patch)
treef24ddc348feb488e16b22682877eaebaf4355802
parent392a7b46a77c109f414513ebac386f1a133ab1c2 (diff)
downloadIshtar-848232371048386bf0602fbca1375df8f6afbc17.tar.bz2
Ishtar-848232371048386bf0602fbca1375df8f6afbc17.zip
Operation sources: if index is not available don't generate an error for codes
-rw-r--r--archaeological_operations/models.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py
index 12773f495..60e9ef98e 100644
--- a/archaeological_operations/models.py
+++ b/archaeological_operations/models.py
@@ -924,6 +924,8 @@ class OperationSource(Source):
@property
def code(self):
+ if not self.index:
+ return u"{}-".format(self.operation.code_patriarche or '')
return u"{}-{:04d}".format(self.operation.code_patriarche or '',
self.index)