aboutsummaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorAndrea Lepori <aleporia@gmail.com>2023-08-16 15:07:53 +0200
committerAndrea Lepori <aleporia@gmail.com>2023-08-16 15:08:17 +0200
commitbae57ae7c971e500b536c67a04cce43e84a44b64 (patch)
tree7a9811c2b5defac4cc406a0ef4df023d0b4f8dfd /client
parentfix hiding docs on phone (diff)
downloadscout-subs-bae57ae7c971e500b536c67a04cce43e84a44b64.tar.gz
scout-subs-bae57ae7c971e500b536c67a04cce43e84a44b64.zip
check if person has a branca
Diffstat (limited to '')
-rw-r--r--client/templates/client/index.html3
-rw-r--r--client/views.py4
2 files changed, 5 insertions, 2 deletions
diff --git a/client/templates/client/index.html b/client/templates/client/index.html
index 2690703..2e714cd 100644
--- a/client/templates/client/index.html
+++ b/client/templates/client/index.html
@@ -433,6 +433,9 @@
{% if data.4 %}
Uno o più allegati medici (certificato di vacinazione o tessera della cassa malati) non sono stati aggiunti.<br>
{% endif %}
+ {% if data.5 %}
+ La persona non è stata assegnata ad una branca.<br>
+ {% endif %}
Per poter creare una nuova iscrizione completare tutti i dati.</p>
</div>
</div>
diff --git a/client/views.py b/client/views.py
index f3124a8..236ae38 100644
--- a/client/views.py
+++ b/client/views.py
@@ -112,11 +112,11 @@ def index(request):
required_medic_fields = ["emer_name", "emer_relative", "cell_phone", "address", "health_care", "injuries", "rc", "medic_name", "medic_phone", "medic_address", "sickness", "vaccine", "tetanus_date"]
data = [uc.__dict__[key] for key in required_fields]
data += [uc.medic.__dict__[key] for key in required_medic_fields]
- invalid_flag = ("" in data) or (None in data) or (dt.date(1970, 1, 1) in data)
+ invalid_flag = ("" in data) or (None in data) or (dt.date(1970, 1, 1) in data) or uc.branca == None
no_attachment_flag = (not uc.medic.vac_certificate) or (not uc.medic.health_care_certificate)
invalid_flag = invalid_flag or no_attachment_flag
all_invalid = all_invalid and invalid_flag
- docs.append([uc, documents, color, invalid_flag, no_attachment_flag])
+ docs.append([uc, documents, color, invalid_flag, no_attachment_flag, uc.branca == None])
# show only docs of the user and non archived
vac_file = ["/server/media/", "/vac_certificate/doc"]