No need to manually put comments from conversation.getComments in an acquisition chain since getComments now returns acquisition wrapped comments.

svn path=/plone.app.discussion/trunk/; revision=51642
This commit is contained in:
Timo Stollenwerk 2011-08-18 07:31:00 +00:00
parent 5045960281
commit 3798338549
2 changed files with 3 additions and 4 deletions

View File

@ -236,7 +236,7 @@ def notify_content_object_moved(obj, event):
# Reindex comment at the new location
conversation = IConversation(obj)
for comment in conversation.getComments():
comment.__parent__.__parent__.__parent__ = event.newParent
aq_base(comment).__parent__.__parent__.__parent__ = event.newParent
catalog.reindexObject(aq_base(comment))

View File

@ -1,4 +1,4 @@
from Acquisition import aq_inner, aq_parent
from Acquisition import aq_inner, aq_base, aq_parent
from zope.annotation.interfaces import IAnnotations
@ -31,9 +31,8 @@ def patchedClearFindAndRebuild(self):
conversation = conversation.__of__(obj)
for comment in conversation.getComments():
try:
comment = comment.__of__(conversation)
if catalog:
catalog.indexObject(comment)
catalog.indexObject(aq_base(comment))
except StopIteration: # pragma: no cover
pass