summaryrefslogtreecommitdiff
path: root/archaeological_operations
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2022-05-10 13:13:21 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2022-05-10 13:13:21 +0200
commitd86d38d75b4ad6a0626cc341687347c8950a1c87 (patch)
treef2c7897c53b4a28e4d7250f77b2b5449aed3a3e3 /archaeological_operations
parent38e5f091e56c25668745679cf638eac67b70db42 (diff)
downloadIshtar-d86d38d75b4ad6a0626cc341687347c8950a1c87.tar.bz2
Ishtar-d86d38d75b4ad6a0626cc341687347c8950a1c87.zip
Operation: fix empty operation prefix in profile (refs #5358)
Diffstat (limited to 'archaeological_operations')
-rw-r--r--archaeological_operations/models.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py
index 2c018ce20..4de3a78e5 100644
--- a/archaeological_operations/models.py
+++ b/archaeological_operations/models.py
@@ -1508,13 +1508,13 @@ class Operation(
profile = get_current_profile()
ref = ""
if self.code_patriarche:
- ref = profile.operation_prefix + str(self.code_patriarche)
+ ref = (profile.operation_prefix or "") + str(self.code_patriarche)
if not full:
return ref
if self.year and self.operation_code:
if ref:
ref += " - "
- ref += profile.default_operation_prefix
+ ref += profile.default_operation_prefix or ""
ref += "-".join((str(self.year), str(self.operation_code)))
return ref or "00"
@@ -1684,7 +1684,7 @@ class Operation(
lbl = str(self.operation_code)
year = self.year or 0
profile = get_current_profile()
- lbl = profile.default_operation_prefix + "%d-%s%s" % (
+ lbl = (profile.default_operation_prefix or "") + "%d-%s%s" % (
year,
(3 - len(lbl)) * "0",
lbl,
@@ -1696,7 +1696,7 @@ class Operation(
if not self.code_patriarche:
return ""
profile = get_current_profile()
- return profile.operation_prefix + self.code_patriarche
+ return (profile.operation_prefix or "") + self.code_patriarche
def clean(self):
if not self.operation_code: