Make 'text/plain' the default mime type for comments and make sure the default type is set properly when creating a new comment.

This commit is contained in:
Timo Stollenwerk
2012-07-12 16:01:07 +02:00
parent f45373b311
commit 702f7e1f1d
3 changed files with 13 additions and 1 deletions
+5 -1
View File
@@ -90,7 +90,7 @@ class Comment(CatalogAware, WorkflowAware, DynamicType, Traversable,
title = u""
mime_type = None
mime_type = "text/plain"
text = u""
creator = None
@@ -205,6 +205,10 @@ def notify_content_object(obj, event):
"""Tell the content object when a comment is added
"""
content_obj = aq_parent(aq_parent(obj))
# set the modified date and reindex the item accordingly
# so that 304s work correctly. This means that adding a comment
# effectively counts as modifying the content type.
content_obj.setModificationDate()
content_obj.reindexObject(idxs=('total_comments',
'last_comment_date',
'commentators',