Skip to content

Commit 5ccc7f7

Browse files
author
Richard Jones
committed
fixed editing of message contents
1 parent 76055b5 commit 5ccc7f7

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ are given with the most recent entry first.
44
2004-10-?? 0.7.9
55
Fixed:
66
- popup listing uses filter args (thanks Marlon van den Berg)
7+
- fixed editing of message contents
78

89

910
2004-10-15 0.7.8

roundup/backends/blobfiles.py

Lines changed: 9 additions & 6 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: blobfiles.py,v 1.12.2.1 2004-06-24 07:14:48 richard Exp $
18+
#$Id: blobfiles.py,v 1.12.2.2 2004-10-15 01:10:22 richard Exp $
1919
'''This module exports file storage for roundup backends.
2020
Files are stored into a directory hierarchy.
2121
'''
@@ -79,11 +79,11 @@ def storefile(self, classname, nodeid, property, content):
7979

8080
# save to a temp file
8181
name = name + '.tmp'
82-
# make sure we don't register the rename action more than once
83-
if not os.path.exists(name):
84-
# save off the rename action
85-
self.transactions.append((self.doStoreFile, (classname, nodeid,
86-
property)))
82+
83+
# save off the rename action
84+
self.transactions.append((self.doStoreFile, (classname, nodeid,
85+
property)))
86+
8787
open(name, 'wb').write(content)
8888

8989
def getfile(self, classname, nodeid, property):
@@ -117,6 +117,9 @@ def doStoreFile(self, classname, nodeid, property, **databases):
117117
# determine the name of the file to write to
118118
name = self.filename(classname, nodeid, property)
119119

120+
if not os.path.exists(name+".tmp"):
121+
return
122+
120123
# content is being updated (and some platforms, eg. win32, won't
121124
# let us rename over the top of the old file)
122125
if os.path.exists(name):

roundup/backends/rdbms_common.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: rdbms_common.py,v 1.98.2.24 2004-10-14 22:28:02 richard Exp $
1+
# $Id: rdbms_common.py,v 1.98.2.25 2004-10-15 01:10:22 richard Exp $
22
''' Relational database (SQL) backend common code.
33
44
Basics:
@@ -2655,19 +2655,23 @@ def set(self, itemid, **propvalues):
26552655
content = propvalues['content']
26562656
del propvalues['content']
26572657

2658-
# do the database create
2658+
# do the database set
26592659
propvalues = self.set_inner(itemid, **propvalues)
26602660

26612661
# do content?
26622662
if content:
26632663
# store and index
26642664
self.db.storefile(self.classname, itemid, None, content)
2665-
mime_type = propvalues.get('type', self.get(itemid, 'type'))
2666-
if not mime_type:
2665+
if self.getprops().has_key('type'):
2666+
mime_type = propvalues.get('type', self.get(itemid, 'type',
2667+
self.default_mime_type))
2668+
else:
26672669
mime_type = self.default_mime_type
26682670
self.db.indexer.add_text((self.classname, itemid, 'content'),
26692671
content, mime_type)
26702672

2673+
propvalues['content'] = content
2674+
26712675
# fire reactors
26722676
self.fireReactors('set', itemid, oldvalues)
26732677
return propvalues

0 commit comments

Comments
 (0)