From: richard Date: Tue, 10 Dec 2002 06:02:00 +0000 (+0000) Subject: Fix to handle bad form submissions, Links and the magic -1 form value. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=67c915cde8cbede3c014669bd4281fc2a050e9f0;p=roundup.git Fix to handle bad form submissions, Links and the magic -1 form value. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1397 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/TODO.txt b/TODO.txt index 88a5335..07eea9c 100644 --- a/TODO.txt +++ b/TODO.txt @@ -69,7 +69,6 @@ pending web implement a python dict version of the form values active web UNIX init.d script for roundup-server bug web query editing isn't fully implemented bug web no testing for parsePropsFromForm -active web revert to showing entire message in classic issue display bug hyperdb pysqlite and locks http://www.hwaci.com/sw/sqlite/c_interface.html bug web implement the request.url attribute? diff --git a/roundup/cgi/client.py b/roundup/cgi/client.py index f45b336..c1c8021 100644 --- a/roundup/cgi/client.py +++ b/roundup/cgi/client.py @@ -1,4 +1,4 @@ -# $Id: client.py,v 1.59 2002-12-10 00:11:15 richard Exp $ +# $Id: client.py,v 1.60 2002-12-10 06:01:59 richard Exp $ __doc__ = """ 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+$')): elif isinstance(proptype, hyperdb.Boolean): value = value.lower() in ('yes', 'true', 'on', '1') - props[propname] = value elif isinstance(proptype, hyperdb.Number): - props[propname] = value = int(value) + value = int(value) # register this as received if required? if propname in required and value is not None: diff --git a/roundup/cgi/templating.py b/roundup/cgi/templating.py index c2e1594..5565fe9 100644 --- a/roundup/cgi/templating.py +++ b/roundup/cgi/templating.py @@ -930,6 +930,13 @@ class LinkHTMLProperty(HTMLProperty): entry identified by the assignedto property on item, and then the name property of that user) ''' + def __init__(self, *args): + HTMLProperty.__init__(self, *args) + # if we're representing a form value, then the -1 from the form really + # should be a None + if str(self._value) == '-1': + self._value = None + def __getattr__(self, attr): ''' return a new HTMLItem ''' #print 'Link.getattr', (self, attr, self._value)