Mercurial > p > roundup > code
diff roundup/cgi/client.py @ 1692:64f448ff07f2
audit some user properties for valid values (roles, address)
[SF#742968] and [SF#739653]
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Tue, 24 Jun 2003 04:16:35 +0000 |
| parents | 388b9bfe4483 |
| children | c9f67f2f7ba7 |
line wrap: on
line diff
--- a/roundup/cgi/client.py Tue Jun 24 03:58:57 2003 +0000 +++ b/roundup/cgi/client.py Tue Jun 24 04:16:35 2003 +0000 @@ -1,4 +1,4 @@ -# $Id: client.py,v 1.122 2003-06-24 03:58:57 richard Exp $ +# $Id: client.py,v 1.123 2003-06-24 04:16:35 richard Exp $ __doc__ = """ WWW request handler (also used in the stand-alone server). @@ -1598,7 +1598,8 @@ # we'll store info about the individual class/item edit in these all_required = {} # required props per class/item - all_props = {} # props present per class/item + all_props = {} # props to set per class/item + got_props = {} # props received per class/item all_propdef = {} # note - only one entry per class all_links = [] # as many as are required @@ -1662,6 +1663,8 @@ if not all_props.has_key(this): all_props[this] = {} props = all_props[this] + if not got_props.has_key(this): + got_props[this] = {} # is this a link command? if d['link']: @@ -1866,6 +1869,10 @@ raise ValueError, _('Error with %s property: %s')%( propname, msg) + # register that we got this property + if value: + got_props[this][propname] = 1 + # get the old value if nodeid and not nodeid.startswith('-'): try: @@ -1914,9 +1921,9 @@ s = [] for thing, required in all_required.items(): # register the values we got - got = all_props.get(thing, {}) + got = got_props.get(thing, {}) for entry in required[:]: - if got.get(entry, ''): + if got.has_key(entry): required.remove(entry) # any required values not present?
