diff options
Diffstat (limited to 'accounts')
-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: |