aboutsummaryrefslogtreecommitdiffstats
path: root/server/views.py
diff options
context:
space:
mode:
authorAndrea Lepori <aleporia@gmail.com>2023-07-28 13:28:10 +0200
committerAndrea Lepori <aleporia@gmail.com>2023-07-28 13:28:10 +0200
commit12485144d5cb57b1f3d8a6115371765f20fcc86b (patch)
tree9e208621013076d811f00201a8fac0193123ce2c /server/views.py
parentfix data request for new uc (diff)
downloadscout-subs-12485144d5cb57b1f3d8a6115371765f20fcc86b.tar.gz
scout-subs-12485144d5cb57b1f3d8a6115371765f20fcc86b.zip
remove branca from uc from admin panel
Diffstat (limited to 'server/views.py')
-rw-r--r--server/views.py13
1 files changed, 12 insertions, 1 deletions
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]: