aboutsummaryrefslogtreecommitdiffstats
path: root/client/views.py
diff options
context:
space:
mode:
authorAndrea Lepori <aleporia@gmail.com>2023-07-27 12:59:39 +0200
committerAndrea Lepori <aleporia@gmail.com>2023-07-27 12:59:40 +0200
commitb645525ec68296a983945156649524b50b51bd1a (patch)
treeb381d4dcbe0b7bf72a84d5987fb7e66237ca7f96 /client/views.py
parentcheck complete data before doc creation (diff)
downloadscout-subs-b645525ec68296a983945156649524b50b51bd1a.tar.gz
scout-subs-b645525ec68296a983945156649524b50b51bd1a.zip
verify attachments upload
Diffstat (limited to 'client/views.py')
-rw-r--r--client/views.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/client/views.py b/client/views.py
index b0029f0..01cb43e 100644
--- a/client/views.py
+++ b/client/views.py
@@ -112,7 +112,9 @@ def index(request):
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)
- docs.append([uc, documents, color, invalid_flag])
+ no_attachment_flag = (not uc.medic.vac_certificate) or (not uc.medic.health_care_certificate)
+ invalid_flag = invalid_flag or no_attachment_flag
+ docs.append([uc, documents, color, invalid_flag, no_attachment_flag])
# show only docs of the user and non archived
vac_file = ["/server/media/", "/vac_certificate/doc"]