diff options
author | Andrea Lepori <aleporia@gmail.com> | 2023-07-25 11:36:32 +0200 |
---|---|---|
committer | Andrea Lepori <aleporia@gmail.com> | 2023-07-25 11:36:32 +0200 |
commit | fbd9bfbddd64da2d24104a55264b344b97c4d022 (patch) | |
tree | 6dbd975c9441d5752e6323937498d38f7deda810 /accounts/views.py | |
parent | create new persons and edit (diff) | |
download | scout-subs-fbd9bfbddd64da2d24104a55264b344b97c4d022.tar.gz scout-subs-fbd9bfbddd64da2d24104a55264b344b97c4d022.zip |
delete uc
Diffstat (limited to 'accounts/views.py')
-rw-r--r-- | accounts/views.py | 10 |
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"] |