Skip to content

Commit 3c1a465

Browse files
author
Richard Jones
committed
merge from HEAD
1 parent 989e78d commit 3c1a465

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

roundup/backends/back_anydbm.py

Lines changed: 17 additions & 1 deletion
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: back_anydbm.py,v 1.146.2.16 2004-07-21 00:51:49 richard Exp $
18+
#$Id: back_anydbm.py,v 1.146.2.17 2004-07-21 01:02:15 richard Exp $
1919
'''This module defines a backend that saves the hyperdatabase in a
2020
database chosen by anydbm. It is guaranteed to always be available in python
2121
versions >2.1.1 (the dumbdbm fallback in 2.1.1 and earlier has several
@@ -1074,6 +1074,13 @@ class or a KeyError is raised.
10741074
'''
10751075
self.fireAuditors('set', nodeid, propvalues)
10761076
oldvalues = copy.deepcopy(self.db.getnode(self.classname, nodeid))
1077+
for name,prop in self.getprops(protected=0).items():
1078+
if oldvalues.has_key(name):
1079+
continue
1080+
if isinstance(prop, Multilink):
1081+
oldvalues[name] = []
1082+
else:
1083+
oldvalues[name] = None
10771084
propvalues = self.set_inner(nodeid, **propvalues)
10781085
self.fireReactors('set', nodeid, oldvalues)
10791086
return propvalues
@@ -2134,7 +2141,16 @@ def set(self, itemid, **propvalues):
21342141
''' Snarf the "content" propvalue and update it in a file
21352142
'''
21362143
self.fireAuditors('set', itemid, propvalues)
2144+
2145+
# create the oldvalues dict - fill in any missing values
21372146
oldvalues = copy.deepcopy(self.db.getnode(self.classname, itemid))
2147+
for name,prop in self.getprops(protected=0).items():
2148+
if oldvalues.has_key(name):
2149+
continue
2150+
if isinstance(prop, Multilink):
2151+
oldvalues[name] = []
2152+
else:
2153+
oldvalues[name] = None
21382154

21392155
# now remove the content property so it's not stored in the db
21402156
content = None

0 commit comments

Comments
 (0)