aboutsummaryrefslogtreecommitdiffstats
path: root/server/views.py
diff options
context:
space:
mode:
authorAndrea Lepori <alepori@student.ethz.ch>2022-01-05 20:30:42 +0100
committerAndrea Lepori <alepori@student.ethz.ch>2022-01-05 20:30:54 +0100
commit576cdae5270b12b36b8a522ce37fac26d46dbde9 (patch)
treeb5fdd3d657c75510ff1faab35098650445ded4fb /server/views.py
parentforce user linked to midata to use midata login (diff)
downloadscout-subs-576cdae5270b12b36b8a522ce37fac26d46dbde9.tar.gz
scout-subs-576cdae5270b12b36b8a522ce37fac26d46dbde9.zip
add radio buttons to custom parameters
Diffstat (limited to 'server/views.py')
-rw-r--r--server/views.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/server/views.py b/server/views.py
index 78be0b2..0e032f0 100644
--- a/server/views.py
+++ b/server/views.py
@@ -672,10 +672,16 @@ def doccreate(request):
# create custom keys
if custom_data:
custom = request.POST["custom"]
- custom.replace("\r", "")
- custom = custom.split("\n")
+ custom = custom.splitlines()
for i in custom:
- key = Keys(key=i, container=doctype)
+ val = i
+ if val.startswith("!"):
+ if len(val) < 3:
+ val = val
+
+ val = val[3:].split(",")[0]
+
+ key = Keys(key=val, key_extra=i, container=doctype)
key.save()
return HttpResponseRedirect('doctype')