diff options
author | Andrea Lepori <alepori@student.ethz.ch> | 2020-07-29 23:58:25 +0200 |
---|---|---|
committer | Andrea Lepori <alepori@student.ethz.ch> | 2020-07-29 23:58:25 +0200 |
commit | 9bb7b7bdfaf4130e1fa8e5f9baf93e9f977f7807 (patch) | |
tree | d136fde09ff4803aefc42f8dbd912ba563715faa /accounts/views.py | |
parent | accept terms on account creation (diff) | |
download | scout-subs-9bb7b7bdfaf4130e1fa8e5f9baf93e9f977f7807.tar.gz scout-subs-9bb7b7bdfaf4130e1fa8e5f9baf93e9f977f7807.zip |
upload signed documents
Diffstat (limited to '')
-rw-r--r-- | accounts/views.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/accounts/views.py b/accounts/views.py index 31786b1..a31d12b 100644 --- a/accounts/views.py +++ b/accounts/views.py @@ -123,11 +123,10 @@ def personal(request): if "vac_certificate" in request.FILES: myfile = request.FILES['vac_certificate'] - medic.save() try: im = Image.open(myfile) im_io = BytesIO() - im.save(im_io, 'WEBP', quality=70) + im.save(im_io, 'WEBP', quality=50) medic.vac_certificate.save(request.user.username+"_"+myfile.name, im_io) medic.save() except UnidentifiedImageError: @@ -139,7 +138,7 @@ def personal(request): try: im = Image.open(myfile) im_io = BytesIO() - im.save(im_io, 'WEBP', quality=70) + im.save(im_io, 'WEBP', quality=50) medic.health_care_certificate.save(request.user.username+"_"+myfile.name, im_io) medic.save() except UnidentifiedImageError: @@ -155,6 +154,9 @@ def personal(request): medic.health_care_certificate = None medic.save() + if not error: + return HttpResponseRedirect("") + if len(request.user.groups.values_list('name', flat=True)) == 0: branca_default = "selected" else: |