From efc777b7a124948b50aa5fa521cba8bde4486fc1 Mon Sep 17 00:00:00 2001 From: richard Date: Tue, 24 Sep 2002 02:00:09 +0000 Subject: [PATCH] better detection of unset required props git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1220 57a73879-2fb5-44c3-a270-3262357dd7e2 --- roundup/cgi/client.py | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/roundup/cgi/client.py b/roundup/cgi/client.py index 2ab969e..dcefb3a 100644 --- a/roundup/cgi/client.py +++ b/roundup/cgi/client.py @@ -1,4 +1,4 @@ -# $Id: client.py,v 1.40 2002-09-19 02:37:41 richard Exp $ +# $Id: client.py,v 1.41 2002-09-24 02:00:09 richard Exp $ __doc__ = """ WWW request handler (also used in the stand-alone server). @@ -1139,30 +1139,29 @@ def parsePropsFromForm(db, cl, form, nodeid=0, num_re=re.compile('^\d+$')): if value: value = date.Date(form[key].value.strip()) else: - value = None + continue elif isinstance(proptype, hyperdb.Interval): if value: value = date.Interval(form[key].value.strip()) else: - value = None + continue elif isinstance(proptype, hyperdb.Link): # see if it's the "no selection" choice if value == '-1': - value = None - else: - # handle key values - link = proptype.classname - if not num_re.match(value): - try: - value = db.classes[link].lookup(value) - except KeyError: - raise ValueError, _('property "%(propname)s": ' - '%(value)s not a %(classname)s')%{'propname':key, - 'value': value, 'classname': link} - except TypeError, message: - raise ValueError, _('you may only enter ID values ' - 'for property "%(propname)s": %(message)s')%{ - 'propname':key, 'message': message} + continue + # handle key values + link = proptype.classname + if not num_re.match(value): + try: + value = db.classes[link].lookup(value) + except KeyError: + raise ValueError, _('property "%(propname)s": ' + '%(value)s not a %(classname)s')%{'propname':key, + 'value': value, 'classname': link} + except TypeError, message: + raise ValueError, _('you may only enter ID values ' + 'for property "%(propname)s": %(message)s')%{ + 'propname':key, 'message': message} elif isinstance(proptype, hyperdb.Multilink): if isinstance(value, type([])): # it's a list of MiniFieldStorages -- 2.30.2