Skip to content

Commit 0cd65cf

Browse files
author
Richard Jones
committed
really fix [SF#663235], and test it
1 parent 54f1975 commit 0cd65cf

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

roundup/cgi/client.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: client.py,v 1.69 2003-01-15 11:07:45 richard Exp $
1+
# $Id: client.py,v 1.70 2003-01-15 11:14:01 richard Exp $
22

33
__doc__ = """
44
WWW request handler (also used in the stand-alone server).
@@ -1207,7 +1207,6 @@ def parsePropsFromForm(db, cl, form, nodeid=0, num_re=re.compile('^\d+$')):
12071207
props = {}
12081208
keys = form.keys()
12091209
properties = cl.getprops()
1210-
existing_cache = {}
12111210
for key in keys:
12121211
# see if we're performing a special multilink action
12131212
mlaction = 'set'
@@ -1331,8 +1330,10 @@ def parsePropsFromForm(db, cl, form, nodeid=0, num_re=re.compile('^\d+$')):
13311330
# we're modifying the list - get the current list of ids
13321331
if props.has_key(propname):
13331332
existing = props[propname]
1334-
else:
1333+
elif nodeid:
13351334
existing = cl.get(nodeid, propname, [])
1335+
else:
1336+
existing = []
13361337

13371338
# now either remove or add
13381339
if mlaction == 'remove':

test/test_cgi.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# but WITHOUT ANY WARRANTY; without even the implied warranty of
99
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1010
#
11-
# $Id: test_cgi.py,v 1.3 2003-01-15 11:07:45 richard Exp $
11+
# $Id: test_cgi.py,v 1.4 2003-01-15 11:14:01 richard Exp $
1212

1313
import unittest, os, shutil, errno, sys, difflib, cgi
1414

@@ -140,6 +140,10 @@ def testMultilinkAdd(self):
140140
self.assertEqual(client.parsePropsFromForm(self.db, self.db.issue,
141141
makeForm({':add:nosy': ['2','3']}), nodeid), {'nosy': ['1','2','3']})
142142

143+
def testMultilinkAddNew(self):
144+
self.assertEqual(client.parsePropsFromForm(self.db, self.db.issue,
145+
makeForm({':add:nosy': ['2','3']})), {'nosy': ['2','3']})
146+
143147
def testMultilinkRemove(self):
144148
nodeid = self.db.issue.create(nosy=['1','2'])
145149
# do nothing

0 commit comments

Comments
 (0)