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:
David Glick
2010-12-15 20:39:55 +00:00
parent b9d929bca3
commit 0cb75778ba
4 changed files with 55 additions and 28 deletions
+11
View File
@@ -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)