diff options
author | Andrea Lepori <aleporia@gmail.com> | 2023-07-28 13:28:10 +0200 |
---|---|---|
committer | Andrea Lepori <aleporia@gmail.com> | 2023-07-28 13:28:10 +0200 |
commit | 12485144d5cb57b1f3d8a6115371765f20fcc86b (patch) | |
tree | 9e208621013076d811f00201a8fac0193123ce2c /server/views.py | |
parent | fix data request for new uc (diff) | |
download | scout-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.py | 13 |
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]:
|