Use adaption instead of calling the conversationAdapterFactory directly.

svn path=/plone.app.discussion/trunk/; revision=27508
This commit is contained in:
Timo Stollenwerk 2009-06-19 10:00:31 +00:00
parent 59586025be
commit c135228419

View File

@ -22,10 +22,9 @@ from plone.registry.interfaces import IRegistry
from plone.app.layout.viewlets.common import ViewletBase from plone.app.layout.viewlets.common import ViewletBase
from plone.app.discussion.interfaces import IConversation, IComment, IReplies, IDiscussionSettings
from plone.app.discussion.conversation import conversationAdapterFactory
from plone.app.discussion.comment import CommentFactory from plone.app.discussion.comment import CommentFactory
from plone.app.discussion.interfaces import IConversation, IComment, IReplies, IDiscussionSettings
class View(BrowserView): class View(BrowserView):
@ -59,12 +58,10 @@ class CommentsViewlet(ViewletBase):
def is_discussion_allowed(self): def is_discussion_allowed(self):
context = aq_inner(self.context) context = aq_inner(self.context)
conversation = conversationAdapterFactory(context) conversation = IConversation(context)
return conversation.enabled return conversation.enabled
def get_replies(self, workflow_actions=False): def get_replies(self, workflow_actions=False):
# Acquisition wrap the conversation
context = aq_inner(self.context) context = aq_inner(self.context)
conversation = IConversation(context) conversation = IConversation(context)