diff options
author | Andrea Lepori <alepori@student.ethz.ch> | 2020-07-31 10:45:56 +0200 |
---|---|---|
committer | Andrea Lepori <alepori@student.ethz.ch> | 2020-07-31 10:45:56 +0200 |
commit | 0d24c3ca2c4810b5000e511900ad603d8b264205 (patch) | |
tree | 72d6529b616bd00ff6f61863d0fc2de11ab6f66d /server/views.py | |
parent | perm staff for non primary group (diff) | |
download | scout-subs-0d24c3ca2c4810b5000e511900ad603d8b264205.tar.gz scout-subs-0d24c3ca2c4810b5000e511900ad603d8b264205.zip |
self delete of medical data
Diffstat (limited to '')
-rw-r--r-- | server/views.py | 7 |
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: |