aboutsummaryrefslogtreecommitdiffstats
path: root/server/views.py
diff options
context:
space:
mode:
authorAndrea Lepori <alepori@student.ethz.ch>2020-07-31 10:45:56 +0200
committerAndrea Lepori <alepori@student.ethz.ch>2020-07-31 10:45:56 +0200
commit0d24c3ca2c4810b5000e511900ad603d8b264205 (patch)
tree72d6529b616bd00ff6f61863d0fc2de11ab6f66d /server/views.py
parentperm staff for non primary group (diff)
downloadscout-subs-0d24c3ca2c4810b5000e511900ad603d8b264205.tar.gz
scout-subs-0d24c3ca2c4810b5000e511900ad603d8b264205.zip
self delete of medical data
Diffstat (limited to 'server/views.py')
-rw-r--r--server/views.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/server/views.py b/server/views.py
index b3db149..b4bd06e 100644
--- a/server/views.py
+++ b/server/views.py
@@ -508,6 +508,9 @@ def doclist(request):
elif request.POST["action"] == 'archive':
if i.status == 'ok':
i.status = 'archive'
+ if i.medical_data:
+ i.medical_data.delete()
+ i.medical_data.save()
i.save()
else:
error = True
@@ -603,9 +606,9 @@ def doclist(request):
medical = None
vac_file = ""
health_file = ""
- if i.document_type.personal_data:
+ if i.personal_data:
personal = i.personal_data
- if i.document_type.medical_data:
+ if i.medical_data:
medical = i.medical_data
if medical.vac_certificate.name:
with open(medical.vac_certificate.name, 'rb') as image_file: