[CMF-checkins] CVS: CMF/CMFDefault - DiscussionTool.py:1.8

Florent Guillaume fg@nuxeo.com
Sat, 29 Jun 2002 21:02:18 -0400


Update of /cvs-repository/CMF/CMFDefault
In directory cvs.zope.org:/tmp/cvs-serv17400

Modified Files:
	DiscussionTool.py 
Log Message:
Make sure we don't acquire a 'talkback' from somewhere else by mistake.


=== CMF/CMFDefault/DiscussionTool.py 1.7 => 1.8 ===
 
 from Globals import InitializeClass, DTMLFile
+from Acquisition import aq_base
 from AccessControl import ClassSecurityInfo
 from OFS.SimpleItem import SimpleItem
 
@@ -99,11 +100,12 @@
         """
         if not self.isDiscussionAllowedFor( content ):
             raise DiscussionNotAllowed
-            
-        talkback = getattr( content, 'talkback', None )
-        if not talkback:
+
+        if hasattr(aq_base(self), 'talkback'):
+            talkback = self.talkback
+        else:
             talkback = self._createDiscussionFor( content )
-        
+
         return talkback
 
     security.declarePublic( 'isDiscussionAllowedFor' )