aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorAndrea Lepori <alepori@student.ethz.ch>2022-09-13 19:49:46 +0200
committerAndrea Lepori <alepori@student.ethz.ch>2022-09-13 19:49:46 +0200
commit4fcf257ad37fad25db594c366dfbcf93ab3bf317 (patch)
tree193d998899028130a9f82e9b58a2e01dfa8de1be /server
parentpermit multiple documents of the same type (diff)
downloadscout-subs-4fcf257ad37fad25db594c366dfbcf93ab3bf317.tar.gz
scout-subs-4fcf257ad37fad25db594c366dfbcf93ab3bf317.zip
remove unused/useless code
Diffstat (limited to '')
-rw-r--r--server/views.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/server/views.py b/server/views.py
index 56a05ec..4133d3c 100644
--- a/server/views.py
+++ b/server/views.py
@@ -300,8 +300,6 @@ def approve_direct(request):
else:
groups = request.user.groups.values_list('name', flat=True)[1:]
- doc_code = -1
-
if request.method == "POST" and "doc_code" in request.POST:
# if user submitted the form to approve a document
doc_code = request.POST["doc_code"]
@@ -761,10 +759,9 @@ def custom_parameters_preview(request):
dic = {}
val = params[i]
if val.startswith("!"):
- if len(val) < 3:
- val = val
+ if len(val) >= 3:
+ val = val[3:].split(",")[0]
- val = val[3:].split(",")[0]
dic["key"] = val
dic["key_extra"] = params[i]
dic["id"] = i
@@ -888,10 +885,8 @@ def doccreate(request):
for i in custom:
val = i
if val.startswith("!"):
- if len(val) < 3:
- val = val
-
- val = val[3:].split(",")[0]
+ if len(val) >= 3:
+ val = val[3:].split(",")[0]
key = Keys(key=val, key_extra=i, container=doctype)
key.save()