make sure comments don't get indexed with their parents' UID in Plone 3. only declare dependency on plone.app.uuid in Python 2.6, since we only use it in Plone 4 currently.
svn path=/plone.app.discussion/trunk/; revision=46353
This commit is contained in:
@@ -16,6 +16,11 @@ from plone.app.discussion.interfaces import IConversation, IComment
|
||||
|
||||
from plone.indexer import indexer
|
||||
|
||||
try:
|
||||
from plone.uuid.interfaces import IUUID
|
||||
except ImportError:
|
||||
IUUID = None
|
||||
|
||||
MAX_DESCRIPTION = 25
|
||||
|
||||
# Conversation Indexers
|
||||
@@ -130,3 +135,9 @@ def comments_last_comment_date(object):
|
||||
@indexer(IComment)
|
||||
def comments_commentators(object):
|
||||
return None
|
||||
|
||||
# Make sure comments don't inherit their container's UID
|
||||
@indexer(IComment)
|
||||
def UID(object):
|
||||
if IUUID:
|
||||
return IUUID(object, None)
|
||||
|
||||
Reference in New Issue
Block a user