From: richard Date: Wed, 21 Nov 2001 03:11:28 +0000 (+0000) Subject: Better handling of new properties. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=73ed245c6f0ac1b2ea67a108253f39400b766244;p=roundup.git Better handling of new properties. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@406 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/roundup/cgi_client.py b/roundup/cgi_client.py index 24ff631..ba3dc94 100644 --- a/roundup/cgi_client.py +++ b/roundup/cgi_client.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: cgi_client.py,v 1.57 2001-11-15 10:24:27 richard Exp $ +# $Id: cgi_client.py,v 1.58 2001-11-21 03:11:28 richard Exp $ import os, cgi, pprint, StringIO, urlparse, re, traceback, mimetypes import binascii, Cookie, time @@ -959,14 +959,26 @@ def parsePropsFromForm(db, cl, form, nodeid=0): l.sort() value = l props[key] = value + + # get the old value + try: + existing = cl.get(nodeid, key) + except KeyError: + # this might be a new property for which there is no existing + # value + if not cl.properties.has_key(key): raise + # if changed, set it - if nodeid and value != cl.get(nodeid, key): + if nodeid and value != existing: changed.append(key) props[key] = value return props, changed # # $Log: not supported by cvs2svn $ +# Revision 1.57 2001/11/15 10:24:27 richard +# handle the case where there is no file attached +# # Revision 1.56 2001/11/14 21:35:21 richard # . users may attach files to issues (and support in ext) through the web now # diff --git a/roundup/hyperdb.py b/roundup/hyperdb.py index 5a4e837..f1d5c14 100644 --- a/roundup/hyperdb.py +++ b/roundup/hyperdb.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: hyperdb.py,v 1.31 2001-11-12 22:01:06 richard Exp $ +# $Id: hyperdb.py,v 1.32 2001-11-21 03:11:28 richard Exp $ # standard python modules import cPickle, re, string @@ -295,9 +295,6 @@ class Class: raise IndexError num_re = re.compile('^\d+$') for key, value in propvalues.items(): - if not node.has_key(key): - raise KeyError, key - # check to make sure we're not duplicating an existing key if key == self.key and node[key] != value: try: @@ -307,6 +304,7 @@ class Class: else: raise ValueError, 'node with key "%s" exists'%value + # this will raise the KeyError if the property isn't valid prop = self.properties[key] if isinstance(prop, Link): @@ -849,6 +847,9 @@ def Choice(name, *options): # # $Log: not supported by cvs2svn $ +# Revision 1.31 2001/11/12 22:01:06 richard +# Fixed issues with nosy reaction and author copies. +# # Revision 1.30 2001/11/09 10:11:08 richard # . roundup-admin now handles all hyperdb exceptions # diff --git a/roundup/templates/extended/htmlbase.py b/roundup/templates/extended/htmlbase.py index 8cd83b2..cdf463a 100644 --- a/roundup/templates/extended/htmlbase.py +++ b/roundup/templates/extended/htmlbase.py @@ -102,7 +102,7 @@ issueDOTindex = """ +issueDOTitem = """ @@ -117,11 +117,19 @@ issueDOTitem = """ +supportDOTitem = """