Skip to content

Commit 73c28cb

Browse files
author
Richard Jones
committed
Better handling of new properties.
1 parent 64ace7b commit 73c28cb

File tree

3 files changed

+32
-11
lines changed

3 files changed

+32
-11
lines changed

roundup/cgi_client.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: cgi_client.py,v 1.57 2001-11-15 10:24:27 richard Exp $
18+
# $Id: cgi_client.py,v 1.58 2001-11-21 03:11:28 richard Exp $
1919

2020
import os, cgi, pprint, StringIO, urlparse, re, traceback, mimetypes
2121
import binascii, Cookie, time
@@ -959,14 +959,26 @@ def parsePropsFromForm(db, cl, form, nodeid=0):
959959
l.sort()
960960
value = l
961961
props[key] = value
962+
963+
# get the old value
964+
try:
965+
existing = cl.get(nodeid, key)
966+
except KeyError:
967+
# this might be a new property for which there is no existing
968+
# value
969+
if not cl.properties.has_key(key): raise
970+
962971
# if changed, set it
963-
if nodeid and value != cl.get(nodeid, key):
972+
if nodeid and value != existing:
964973
changed.append(key)
965974
props[key] = value
966975
return props, changed
967976

968977
#
969978
# $Log: not supported by cvs2svn $
979+
# Revision 1.57 2001/11/15 10:24:27 richard
980+
# handle the case where there is no file attached
981+
#
970982
# Revision 1.56 2001/11/14 21:35:21 richard
971983
# . users may attach files to issues (and support in ext) through the web now
972984
#

roundup/hyperdb.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: hyperdb.py,v 1.31 2001-11-12 22:01:06 richard Exp $
18+
# $Id: hyperdb.py,v 1.32 2001-11-21 03:11:28 richard Exp $
1919

2020
# standard python modules
2121
import cPickle, re, string
@@ -295,9 +295,6 @@ class or a KeyError is raised.
295295
raise IndexError
296296
num_re = re.compile('^\d+$')
297297
for key, value in propvalues.items():
298-
if not node.has_key(key):
299-
raise KeyError, key
300-
301298
# check to make sure we're not duplicating an existing key
302299
if key == self.key and node[key] != value:
303300
try:
@@ -307,6 +304,7 @@ class or a KeyError is raised.
307304
else:
308305
raise ValueError, 'node with key "%s" exists'%value
309306

307+
# this will raise the KeyError if the property isn't valid
310308
prop = self.properties[key]
311309

312310
if isinstance(prop, Link):
@@ -849,6 +847,9 @@ def Choice(name, *options):
849847

850848
#
851849
# $Log: not supported by cvs2svn $
850+
# Revision 1.31 2001/11/12 22:01:06 richard
851+
# Fixed issues with nosy reaction and author copies.
852+
#
852853
# Revision 1.30 2001/11/09 10:11:08 richard
853854
# . roundup-admin now handles all hyperdb exceptions
854855
#

roundup/templates/extended/htmlbase.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
</tr>
103103
"""
104104

105-
issueDOTitem = """<!-- dollarId: issue.item,v 1.5 2001/07/30 08:03:56 richard Exp dollar-->
105+
issueDOTitem = """<!-- dollarId: issue.item,v 1.7 2001/11/21 02:34:18 richard Exp dollar-->
106106
<table border=0 cellspacing=0 cellpadding=2>
107107
108108
<tr class="strong-header">
@@ -117,11 +117,19 @@
117117
<tr bgcolor="ffffea">
118118
<td width=1% nowrap align=right><span class="form-label">Product</span></td>
119119
<td class="form-text" valign=middle><display call="menu('product')">
120-
version:<display call="field('version', 5)"></td>
121-
<td width=1% nowrap align=right><span class="form-label">Platform</span></td>
122-
<td class="form-text" valign=middle><display call="checklist('platform')"></td>
120+
<span class="form-label">version:</span><display call="field('version', 5)"></td>
121+
<td rowspan=2 width=1% nowrap align=right><span class="form-label">Platform</span></td>
122+
<td rowspan=2 class="form-text" valign=middle><display call="checklist('platform')"></td>
123123
</tr>
124124
125+
<tr bgcolor="ffffea">
126+
<td width=1% nowrap align=right>&nbsp;</td>
127+
<td align=left><span class="form-label">Target Version</span>
128+
<display call="field('targetversion', 5)">
129+
</td>
130+
</tr>
131+
132+
125133
<tr bgcolor="ffffea">
126134
<td width=1% nowrap align=right><span class="form-label">Created</span></td>
127135
<td class="form-text"><display call="reldate('creation', pretty=1)">
@@ -481,7 +489,7 @@
481489
</tr>
482490
"""
483491

484-
supportDOTitem = """<!-- dollarId: support.item,v 1.2 2001/07/30 08:03:56 richard Exp dollar-->
492+
supportDOTitem = """<!-- dollarId: support.item,v 1.3 2001/11/14 21:35:22 richard Exp dollar-->
485493
<table border=0 cellspacing=0 cellpadding=2>
486494
487495
<tr class="strong-header">

0 commit comments

Comments
 (0)