diff options
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 |
commit | 848232371048386bf0602fbca1375df8f6afbc17 (patch) | |
tree | f24ddc348feb488e16b22682877eaebaf4355802 | |
parent | 392a7b46a77c109f414513ebac386f1a133ab1c2 (diff) | |
download | Ishtar-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.py | 2 |
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) |