aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Šmerkl <46304018+SveterCZE@users.noreply.github.com>2021-10-17 20:33:33 +0200
committerPetr Šmerkl <46304018+SveterCZE@users.noreply.github.com>2021-10-17 20:33:33 +0200
commit946b1802edd31db493641a9a04111c2e4141f2cf (patch)
tree4d21a82641f90ddec0ea5218f8e6f5b05d782519
parent8ce7411bc08f0be3e75287d06b8356c103a014e2 (diff)
downloadjustice-946b1802edd31db493641a9a04111c2e4141f2cf.tar.gz
update how the ubo address is displayed
-rw-r--r--models.py7
-rw-r--r--templates/extract-actual.html2
-rw-r--r--templates/extract.html2
3 files changed, 9 insertions, 2 deletions
diff --git a/models.py b/models.py
index 400e5de..2b41a39 100644
--- a/models.py
+++ b/models.py
@@ -505,7 +505,14 @@ class Adresy_v2(db.Model):
joined_address += self.obec
if (self.stat != "Česká republika") and (self.stat != "Česká republika - neztotožněno") and (self.stat != "0"):
joined_address += ", " + self.stat
+ # if joined_address == "":
+ # return "adresa nedostupná"
+ # else:
return joined_address
+
+ def __len__(self):
+ address_text = self.__repr__()
+ return len(address_text)
class Insolvency_Events(db.Model):
__tablename__ = "insolvency_events"
diff --git a/templates/extract-actual.html b/templates/extract-actual.html
index 691dae3..9a82bff 100644
--- a/templates/extract-actual.html
+++ b/templates/extract-actual.html
@@ -499,7 +499,7 @@
{% for i in range (ubo_notes|length) %}
<tr>
<td></td>
- <td>{{ubo_notes[i].jmeno }} {{ubo_notes[i].jmeno.adresa }}
+ <td>{{ubo_notes[i].jmeno }}{% if ubo_notes[i].jmeno.adresa|length > 0 %}, {{ubo_notes[i].jmeno.adresa }} {% endif %}
{% if ubo_notes[i].postaveni != "0" %}<br>{{ ubo_notes[i].postaveni }}{% endif %}
{% if ubo_notes[i].koncovyPrijemceText != "0" %}<br>{{ ubo_notes[i].koncovyPrijemceText }}{% endif %}
</td>
diff --git a/templates/extract.html b/templates/extract.html
index 9eb1985..b3015d0 100644
--- a/templates/extract.html
+++ b/templates/extract.html
@@ -606,7 +606,7 @@
{% set underlne_style_open = "" %}
{% set underlne_style_close = "" %}
{% endif %}
- <td>{{ underlne_style_open|safe }} {{row.ubo[i].jmeno }} {{row.ubo[i].jmeno.adresa}}
+ <td>{{ underlne_style_open|safe }} {{row.ubo[i].jmeno }}{% if row.ubo[i].jmeno.adresa|length > 0 %}, {{row.ubo[i].jmeno.adresa }} {% endif %}
{% if row.ubo[i].postaveni != "0" %}<br>{{row.ubo[i].postaveni }}{% endif %}
{% if row.ubo[i].koncovyPrijemceText != "0" %}<br>{{row.ubo[i].koncovyPrijemceText }}{% endif %} {{ underlne_style_close|safe }}</td>
<td>{{ underlne_style_open|safe }} Zapsáno: {{ row.ubo[i].zapis_datum }} {% if row.ubo[i].vymaz_datum != 0 %} <br> Vymazáno: {{ row.ubo[i].vymaz_datum }} {% endif %} {{ underlne_style_close|safe }}</td>