diff roundup/backends/rdbms_common.py @ 2512:f5542d92307a

fix anydbm journal import [SF#983166] fix dumb bug in FileClass index()
author Richard Jones <richard@users.sourceforge.net>
date Thu, 01 Jul 2004 03:55:47 +0000
parents 8e1c1623710b
children 091711fb2f8c
line wrap: on
line diff
--- a/roundup/backends/rdbms_common.py	Tue Jun 29 22:15:13 2004 +0000
+++ b/roundup/backends/rdbms_common.py	Thu Jul 01 03:55:47 2004 +0000
@@ -1,4 +1,4 @@
-# $Id: rdbms_common.py,v 1.114 2004-06-29 05:51:38 richard Exp $
+# $Id: rdbms_common.py,v 1.115 2004-07-01 03:55:47 richard Exp $
 ''' Relational database (SQL) backend common code.
 
 Basics:
@@ -2655,9 +2655,10 @@
 
         Pass on the content-type property for the content property.
         '''
-        Class.index(nodeid)
-        mime_type = self.get(itemid, 'type')
-        if not mime_type:
+        Class.index(self, nodeid)
+        try:
+            mime_type = self.get(nodeid, 'type', self.default_mime_type)
+        except KeyError:
             mime_type = self.default_mime_type
         self.db.indexer.add_text((self.classname, nodeid, 'content'),
             str(self.get(nodeid, 'content')), mime_type)

Roundup Issue Tracker: http://roundup-tracker.org/