aboutsummaryrefslogtreecommitdiffstats
path: root/accounts/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/views.py')
-rw-r--r--accounts/views.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/accounts/views.py b/accounts/views.py
index 35dca92..145fa9e 100644
--- a/accounts/views.py
+++ b/accounts/views.py
@@ -863,6 +863,16 @@ def edit(request, code):
elif err.code == "password_incorrect":
errors.append("La password attuale รจ incorretta")
+ elif request.POST['action'] == "delete_uc":
+ confirm_name = request.POST['del_name']
+ correct_name = usercode.first_name + " " + usercode.last_name
+ if (confirm_name == correct_name):
+ usercode.delete()
+ medic.delete()
+ return HttpResponseRedirect("/")
+
+ errors.append("Il nome inserito non corrisponde al nome salvato")
+
else:
# set all attributes
usercode.first_name = request.POST["first_name"]