Skip to content

Commit 4f0774a

Browse files
author
Richard Jones
committed
Fix to handle bad form submissions, Links and the magic -1 form value.
1 parent 7c059e3 commit 4f0774a

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

TODO.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ pending web implement a python dict version of the form values
6969
active web UNIX init.d script for roundup-server
7070
bug web query editing isn't fully implemented
7171
bug web no testing for parsePropsFromForm
72-
active web revert to showing entire message in classic issue display
7372
bug hyperdb pysqlite and locks
7473
http://www.hwaci.com/sw/sqlite/c_interface.html
7574
bug web implement the request.url attribute?

roundup/cgi/client.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: client.py,v 1.59 2002-12-10 00:11:15 richard Exp $
1+
# $Id: client.py,v 1.60 2002-12-10 06:01:59 richard Exp $
22

33
__doc__ = """
44
WWW request handler (also used in the stand-alone server).
@@ -1309,9 +1309,8 @@ def parsePropsFromForm(db, cl, form, nodeid=0, num_re=re.compile('^\d+$')):
13091309

13101310
elif isinstance(proptype, hyperdb.Boolean):
13111311
value = value.lower() in ('yes', 'true', 'on', '1')
1312-
props[propname] = value
13131312
elif isinstance(proptype, hyperdb.Number):
1314-
props[propname] = value = int(value)
1313+
value = int(value)
13151314

13161315
# register this as received if required?
13171316
if propname in required and value is not None:

roundup/cgi/templating.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -930,6 +930,13 @@ class LinkHTMLProperty(HTMLProperty):
930930
entry identified by the assignedto property on item, and then the
931931
name property of that user)
932932
'''
933+
def __init__(self, *args):
934+
HTMLProperty.__init__(self, *args)
935+
# if we're representing a form value, then the -1 from the form really
936+
# should be a None
937+
if str(self._value) == '-1':
938+
self._value = None
939+
933940
def __getattr__(self, attr):
934941
''' return a new HTMLItem '''
935942
#print 'Link.getattr', (self, attr, self._value)

0 commit comments

Comments
 (0)