diff options
author | Andrea Lepori <alepori@student.ethz.ch> | 2022-01-05 20:30:42 +0100 |
---|---|---|
committer | Andrea Lepori <alepori@student.ethz.ch> | 2022-01-05 20:30:54 +0100 |
commit | 576cdae5270b12b36b8a522ce37fac26d46dbde9 (patch) | |
tree | b5fdd3d657c75510ff1faab35098650445ded4fb /server | |
parent | force user linked to midata to use midata login (diff) | |
download | scout-subs-576cdae5270b12b36b8a522ce37fac26d46dbde9.tar.gz scout-subs-576cdae5270b12b36b8a522ce37fac26d46dbde9.zip |
add radio buttons to custom parameters
Diffstat (limited to '')
-rw-r--r-- | server/views.py | 12 |
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')
|