Skip to content

Commit 04ec03e

Browse files
author
Richard Jones
committed
handle dropped properies in rdbms/metakit journal export [SF#1203569]
1 parent 5798c56 commit 04ec03e

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Fixed:
2424
- fixed templating menu() sort_on handling (sf bug 1221936)
2525
- allow specification of pagesize, sorting and filtering in "classhelp"
2626
popups (sf bug 1211800)
27+
- handle dropped properies in rdbms/metakit journal export (sf bug 1203569)
2728

2829

2930
2005-05-02 0.8.3

roundup/backends/back_metakit.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: back_metakit.py,v 1.95 2005-06-08 03:41:46 anthonybaxter Exp $
1+
# $Id: back_metakit.py,v 1.96 2005-06-24 06:38:14 richard Exp $
22
'''Metakit backend for Roundup, originally by Gordon McMillan.
33
44
Known Current Bugs:
@@ -1705,7 +1705,12 @@ def export_journals(self):
17051705
for nodeid, date, user, action, params in self.history(nodeid):
17061706
date = date.get_tuple()
17071707
if action == 'set':
1708+
export_data = {}
17081709
for propname, value in params.items():
1710+
if not properties.has_key(propname):
1711+
# property no longer in the schema
1712+
continue
1713+
17091714
prop = properties[propname]
17101715
# make sure the params are eval()'able
17111716
if value is None:
@@ -1716,7 +1721,8 @@ def export_journals(self):
17161721
value = value.get_tuple()
17171722
elif isinstance(prop, Password):
17181723
value = str(value)
1719-
params[propname] = value
1724+
export_data[propname] = value
1725+
params = export_data
17201726
l = [nodeid, date, user, action, params]
17211727
r.append(map(repr, l))
17221728
return r

roundup/backends/rdbms_common.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: rdbms_common.py,v 1.155 2005-05-18 05:21:14 richard Exp $
1+
# $Id: rdbms_common.py,v 1.156 2005-06-24 06:38:14 richard Exp $
22
''' Relational database (SQL) backend common code.
33
44
Basics:
@@ -2491,7 +2491,12 @@ def export_journals(self):
24912491
for nodeid, date, user, action, params in self.history(nodeid):
24922492
date = date.get_tuple()
24932493
if action == 'set':
2494+
export_data = {}
24942495
for propname, value in params.items():
2496+
if not properties.has_key(propname):
2497+
# property no longer in the schema
2498+
continue
2499+
24952500
prop = properties[propname]
24962501
# make sure the params are eval()'able
24972502
if value is None:
@@ -2502,7 +2507,8 @@ def export_journals(self):
25022507
value = value.get_tuple()
25032508
elif isinstance(prop, Password):
25042509
value = str(value)
2505-
params[propname] = value
2510+
export_data[propname] = value
2511+
params = export_data
25062512
l = [nodeid, date, user, action, params]
25072513
r.append(map(repr, l))
25082514
return r

0 commit comments

Comments
 (0)