From 576cdae5270b12b36b8a522ce37fac26d46dbde9 Mon Sep 17 00:00:00 2001 From: Andrea Lepori Date: Wed, 5 Jan 2022 20:30:42 +0100 Subject: add radio buttons to custom parameters --- server/views.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'server') 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') -- cgit v1.2.1