From c30957f811e92f56c480a88adc41b30fe976fbb5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Valenta?= <git@imaniti.org>
Date: Mon, 13 Nov 2023 17:44:06 +0100
Subject: [PATCH] update required address bits

---
 contracts/models.py                              | 7 +++++--
 contracts/templates/contracts/view_contract.html | 6 +++---
 contracts/templates/contracts/view_signee.html   | 4 ++--
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/contracts/models.py b/contracts/models.py
index fea9d9e..380e736 100644
--- a/contracts/models.py
+++ b/contracts/models.py
@@ -222,7 +222,7 @@ class Signee(
             "address_zip",
             "address_country",
         ):
-            if getattr(self, field):
+            if getattr(self, field) not in ("", None):
                 return True
 
         return False
@@ -247,7 +247,10 @@ class Signee(
                 }
             )
 
-        if self.entity_type != self.EntityTypes.OTHER:
+        if self.entity_type not in (
+            self.EntityTypes.OTHER,
+            self.EntityTypes.NATURAL_PERSON,
+        ):
             for field in (
                 "address_street_with_number",
                 "address_district",
diff --git a/contracts/templates/contracts/view_contract.html b/contracts/templates/contracts/view_contract.html
index 5dd22bb..284c72b 100644
--- a/contracts/templates/contracts/view_contract.html
+++ b/contracts/templates/contracts/view_contract.html
@@ -448,7 +448,7 @@
                                 {% if not signature.signee.entity_has_public_address %}
                                     {% if user.can_view_confidential %}
                                         <div class="flex items-center mb-3">
-                                            {% include "contracts/includes/private_info_icon.html" %}<span class="text-red-600">Máš přístup k celé adrese.</span>
+                                            {% include "contracts/includes/private_info_icon.html" %}<span class="text-red-600">Máš přístup k soukromým informacím.</span>
                                         </div>
                                     {% else %}
                                         <span class="text-gray-500">(zobrazujeme pouze obec)</span>
@@ -467,12 +467,12 @@
                             {% endif %}
 
                             {% if signature.signee.ico_number %}
-                                <br><br>
+                                <br>
                                 <strong>IÄŚO</strong>: {{ signature.signee.ico_number }}
                             {% endif %}
 
                             {% if user.can_view_confidential and signature.signee.date_of_birth %}
-                                <br><br>
+                                <br>
                                 <strong>Datum narozenĂ­</strong>: {{ signature.signee.date_of_birth }}
                             {% endif %}
 
diff --git a/contracts/templates/contracts/view_signee.html b/contracts/templates/contracts/view_signee.html
index 51272f0..2994660 100644
--- a/contracts/templates/contracts/view_signee.html
+++ b/contracts/templates/contracts/view_signee.html
@@ -49,12 +49,12 @@
             {% endif %}
 
             {% if signee.ico_number %}
-                <br><br>
+                <br>
                 <strong>IÄŚO</strong>: {{ signee.ico_number }}
             {% endif %}
 
             {% if user.can_view_confidential and signee.date_of_birth %}
-                <br><br>
+                <br>
                 <strong>Datum narozenĂ­</strong>: {{ signee.date_of_birth }}
             {% endif %}
 
-- 
GitLab