diff options
| 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 | 
| commit | b39e5c16dee6088b88ec3c24b34aabdf9c9da4a1 (patch) | |
| tree | f2c7897c53b4a28e4d7250f77b2b5449aed3a3e3 | |
| parent | d3d36390632b776324f38698742e33e5d9c871da (diff) | |
| download | Ishtar-b39e5c16dee6088b88ec3c24b34aabdf9c9da4a1.tar.bz2 Ishtar-b39e5c16dee6088b88ec3c24b34aabdf9c9da4a1.zip  | |
Operation: fix empty operation prefix in profile (refs #5358)
| -rw-r--r-- | archaeological_operations/models.py | 8 | 
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:  | 
