summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 023dbd0)
raw | patch | inline | side by side (parent: 023dbd0)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 8 Jan 2003 04:33:56 +0000 (04:33 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 8 Jan 2003 04:33:56 +0000 (04:33 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1423 57a73879-2fb5-44c3-a270-3262357dd7e2
CHANGES.txt | patch | blob | history | |
roundup/cgi/client.py | patch | blob | history |
diff --git a/CHANGES.txt b/CHANGES.txt
index 171bd3e74d07960d43fa0bb1f273ad42dfcf1a94..9f75e69b5f31472d4abd8a1648f0773fe9cb3278 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
(multipart/alternative, "fw" and content-type "name")
- fire auditors and reactors in rdbms retire (thanks Sheila King)
- better match for mailgw help "command" text
+- handle :add: better in cgi form parsing (sf bug 663235)
2002-12-11 0.5.3
diff --git a/roundup/cgi/client.py b/roundup/cgi/client.py
index 856bad8da170d1871ad1866c67051c73877aba49..cd85e6352fc0661d9bb32c75c251ad331c4cb512 100644 (file)
--- a/roundup/cgi/client.py
+++ b/roundup/cgi/client.py
-# $Id: client.py,v 1.63 2002-12-15 23:55:33 richard Exp $
+# $Id: client.py,v 1.64 2003-01-08 04:33:56 richard Exp $
__doc__ = """
WWW request handler (also used in the stand-alone server).
# does the property exist?
if not properties.has_key(propname):
- if mlaction != 'set':
+ if mlaction == 'remove':
raise ValueError, 'You have submitted a remove action for'\
' the property "%s" which doesn\'t exist'%propname
continue
# of MiniFieldStorages.
value = form[key]
- # make sure non-multilinks only get one value
- if not isinstance(proptype, hyperdb.Multilink):
+ # handle unpacking of the MiniFieldStorage / list form value
+ if isinstance(proptype, hyperdb.Multilink):
+ # multiple values are OK
+ if isinstance(value, type([])):
+ # it's a list of MiniFieldStorages
+ value = [i.value.strip() for i in value]
+ else:
+ # it's a MiniFieldStorage, but may be a comma-separated list
+ # of values
+ value = [i.strip() for i in value.value.split(',')]
+ else:
+ # multiple values are not OK
if isinstance(value, type([])):
raise ValueError, 'You have submitted more than one value'\
' for the %s property'%propname
'for property "%(propname)s": %(message)s')%{
'propname': propname, 'message': message}
elif isinstance(proptype, hyperdb.Multilink):
- if isinstance(value, type([])):
- # it's a list of MiniFieldStorages
- value = [i.value.strip() for i in value]
- else:
- # it's a MiniFieldStorage, but may be a comma-separated list
- # of values
- value = [i.strip() for i in value.value.split(',')]
+ # perform link class key value lookup if necessary
link = proptype.classname
l = []
- for entry in map(str, value):
+ for entry in value:
if entry == '': continue
if not num_re.match(entry):
try: