summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ba9ec8c)
raw | patch | inline | side by side (parent: ba9ec8c)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Tue, 18 Feb 2003 06:15:21 +0000 (06:15 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Tue, 18 Feb 2003 06:15:21 +0000 (06:15 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1524 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/cgi/client.py | patch | blob | history | |
test/test_cgi.py | patch | blob | history |
diff --git a/roundup/cgi/client.py b/roundup/cgi/client.py
index 10c0e8d89f2eecc8be7aadd25e5ee4747b3cb917..5ba910a5d8b41897404fcc2f29d989b67be3af85 100644 (file)
--- a/roundup/cgi/client.py
+++ b/roundup/cgi/client.py
-# $Id: client.py,v 1.93 2003-02-18 04:56:29 richard Exp $
+# $Id: client.py,v 1.94 2003-02-18 06:15:21 richard Exp $
__doc__ = """
WWW request handler (also used in the stand-alone server).
m = []
for needed in order:
props = all_props[needed]
+ if not props:
+ # nothing to do
+ continue
cn, nodeid = needed
if nodeid is not None and int(nodeid) > 0:
value.append((m.group(1), m.group(2)))
# make sure the link property is valid
- if (not isinstance(propdef, hyperdb.Multilink) and
- not isinstance(propdef, hyperdb.Link)):
+ if (not isinstance(propdef[propname], hyperdb.Multilink) and
+ not isinstance(propdef[propname], hyperdb.Link)):
raise ValueError, '%s %s is not a link or '\
'multilink property'%(cn, propname)
cl = self.db.classes[cn]
if not isinstance(cl, hyperdb.FileClass):
continue
+ # we also don't want to create FileClass items with no content
if not props.get('content', ''):
del all_props[(cn, id)]
diff --git a/test/test_cgi.py b/test/test_cgi.py
index 92db0e75371d2a116786fe279bc936cf8d5f9700..d8c49fb8b2ba0aff2109b833d2363775c10cbca9 100644 (file)
--- a/test/test_cgi.py
+++ b/test/test_cgi.py
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: test_cgi.py,v 1.10 2003-02-17 06:44:01 richard Exp $
+# $Id: test_cgi.py,v 1.11 2003-02-18 06:15:21 richard Exp $
import unittest, os, shutil, errno, sys, difflib, cgi, re
self.assertRaises(ValueError, self.parseForm,
{'test-1@link@link': 'issue'})
+ def testLinkNotLink(self):
+ self.assertRaises(ValueError, self.parseForm,
+ {'test-1@link@boolean': 'issue-1'})
+ self.assertRaises(ValueError, self.parseForm,
+ {'test-1@link@string': 'issue-1'})
+
def testBackwardsCompat(self):
res = self.parseForm({':note': 'spam'}, 'issue')
date = res[0][('msg', '-1')]['date']