summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1928db0)
raw | patch | inline | side by side (parent: 1928db0)
author | schlatterbeck <schlatterbeck@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 14 Dec 2009 19:43:44 +0000 (19:43 +0000) | ||
committer | schlatterbeck <schlatterbeck@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 14 Dec 2009 19:43:44 +0000 (19:43 +0000) |
action in web template is name="issue-1@link@msg" value="msg1" would
trigger a traceback about an unbound variable. Add new regression test
for this case.
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4408 57a73879-2fb5-44c3-a270-3262357dd7e2
trigger a traceback about an unbound variable. Add new regression test
for this case.
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4408 57a73879-2fb5-44c3-a270-3262357dd7e2
CHANGES.txt | patch | blob | history | |
roundup/cgi/actions.py | patch | blob | history | |
test/test_actions.py | patch | blob | history |
diff --git a/CHANGES.txt b/CHANGES.txt
index 4d08af625838b6392e0c63c8d835019471ba3e8d..7cafd2b38f3334fb3e89fedfc65d761a20bbde1a 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
- Fix styling of calendar to make it more usable, fixes issue2550608
- Fix typo in email section of user guide, fixes issue2550607
- Fix WSGI response code (thanks Peter Pöml)
-
+- Fix linking of an existing item to a newly created item, e.g.
+ edit action in web template is name="issue-1@link@msg" value="msg1"
+ would trigger a traceback about an unbound variable.
+ Add new regression test for this case.
2009-10-09 1.4.10 (r4374)
diff --git a/roundup/cgi/actions.py b/roundup/cgi/actions.py
index 54af46911ad4fcb3d0953b6cf17542ed4462486b..c19849413aff73dc169ead6b0e6ba347f8996267 100755 (executable)
--- a/roundup/cgi/actions.py
+++ b/roundup/cgi/actions.py
if linkid is None or linkid.startswith('-'):
# linking to a new item
if isinstance(propdef, hyperdb.Multilink):
- props[linkprop] = [newid]
+ props[linkprop] = [nodeid]
else:
- props[linkprop] = newid
+ props[linkprop] = nodeid
else:
# linking to an existing item
if isinstance(propdef, hyperdb.Multilink):
existing.append(nodeid)
props[linkprop] = existing
else:
- props[linkprop] = newid
+ props[linkprop] = nodeid
return '<br>'.join(m)
diff --git a/test/test_actions.py b/test/test_actions.py
index 82fd6b43cf6bbb54de6cb94396ee0f0d44f306de..edebe0c4a5d6d256a35dc930f8a4e84671373c4a 100755 (executable)
--- a/test/test_actions.py
+++ b/test/test_actions.py
({'messages':hyperdb.Multilink('msg')
,'content':hyperdb.String()
,'files':hyperdb.Multilink('file')
+ ,'msg':hyperdb.Link('msg')
})
self.action = EditItemAction(self.client)
pass
self.assertEqual(expect, self.result)
+ def testLinkNewToExisting(self):
+ expect = [('create',(),{'msg':'1','title':'TEST'})]
+ self.client.db.classes.get = lambda a, b:['23','42']
+ self.client.parsePropsFromForm = lambda: \
+ ( {('issue','-1'):{'title':'TEST'},('msg','1'):{}}
+ , [('issue','-1','msg',[('msg','1')])]
+ )
+ try :
+ self.action.handle()
+ except Redirect, msg:
+ pass
+ self.assertEqual(expect, self.result)
+
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(RetireActionTestCase))