From 848232371048386bf0602fbca1375df8f6afbc17 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 1 Aug 2017 10:47:58 +0200 Subject: Operation sources: if index is not available don't generate an error for codes --- archaeological_operations/models.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'archaeological_operations') 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) -- cgit v1.2.3