From e1deaaf4a239db742cea2d1e6c4f48a9656d8a0f Mon Sep 17 00:00:00 2001 From: Andrea Lepori Date: Sun, 26 Jul 2020 21:28:06 +0200 Subject: bug fixes and visual improvements --- accounts/templates/accounts/index.html | 21 ++++++++++++++++++--- accounts/views.py | 10 +++++----- 2 files changed, 23 insertions(+), 8 deletions(-) (limited to 'accounts') diff --git a/accounts/templates/accounts/index.html b/accounts/templates/accounts/index.html index 9a8a79c..69d0717 100644 --- a/accounts/templates/accounts/index.html +++ b/accounts/templates/accounts/index.html @@ -75,7 +75,7 @@
- @@ -278,7 +278,7 @@
file_uploadFile - +
@@ -298,7 +298,7 @@
file_uploadFile - +
@@ -377,6 +377,21 @@ $(document).ready(function() { {% if error %} M.toast({html: '{{ error_text}}', classes: 'orange'}) {% endif %} + + document.getElementById("vac_certificate").onchange = function() { + if(this.files[0].size > 1048576*10){ + M.toast({html: 'Il file è troppo grande. Grandezza massima 10MB', classes: 'orange'}); + this.value = ""; + } + }; + + document.getElementById("health_care_certificate").onchange = function() { + if(this.files[0].size > 1048576*10){ + M.toast({html: 'Il file è troppo grande. Grandezza massima 10MB', classes: 'orange'}); + this.value = ""; + } + }; + }); /*! diff --git a/accounts/views.py b/accounts/views.py index 562524e..cc402d2 100644 --- a/accounts/views.py +++ b/accounts/views.py @@ -86,11 +86,11 @@ def personal(request): medic.misc = request.POST["misc"] medic.save() - if "branca" in request.POST: - if request.POST["branca"] != "": - request.user.groups.clear() - request.user.groups.add( - Group.objects.get(name=request.POST["branca"])) + #if "branca" in request.POST: + # if request.POST["branca"] != "": + # request.user.groups.clear() + # request.user.groups.add( + # Group.objects.get(name=request.POST["branca"])) if "vac_certificate" in request.FILES: myfile = request.FILES['vac_certificate'] -- cgit v1.2.1