From 12485144d5cb57b1f3d8a6115371765f20fcc86b Mon Sep 17 00:00:00 2001 From: Andrea Lepori Date: Fri, 28 Jul 2023 13:28:10 +0200 Subject: remove branca from uc from admin panel --- server/templates/server/user_list.html | 21 +++++++++++++++++++++ server/views.py | 13 ++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) (limited to 'server') diff --git a/server/templates/server/user_list.html b/server/templates/server/user_list.html index 22788e9..95e205c 100644 --- a/server/templates/server/user_list.html +++ b/server/templates/server/user_list.html @@ -34,6 +34,27 @@ {{user.first_name}} {{user.last_name}}
+ + +
  • confirmation_numberU{{user.code}} diff --git a/server/views.py b/server/views.py index 235c6e5..e264b68 100644 --- a/server/views.py +++ b/server/views.py @@ -375,8 +375,19 @@ def ulist(request): groups = getGroups(request) if request.method == "POST": + # request to remove uc from branca + if request.POST["action"][0] == 'd': + uc = UserCode.objects.get(id=request.POST["action"][1:]) + + # check if user has permission to remove usercode + if uc.branca not in groups: + return + + uc.branca = None + uc.save() + # request to download document - if request.POST["action"][0] == 'f': + elif request.POST["action"][0] == 'f': document = Document.objects.get(id=request.POST["action"][1:]) # check if user has permission to view document if document.group == groups[0]: -- cgit v1.2.1