fixed #662654: As an administrator, I can configure a Collection to show

recent comments.

Type now correctly returns FTI type title. A catalog rebuild is
necessary.

svn path=/plone.app.discussion/trunk/; revision=35266
This commit is contained in:
Florian Friesdorf 2010-03-18 13:22:16 +00:00
parent 5e6c7f6fdb
commit 8150617081
3 changed files with 7 additions and 2 deletions

View File

@ -4,6 +4,10 @@ Changelog
1.0b4 (unreleased) 1.0b4 (unreleased)
------------------ ------------------
* Fix #662654: As an administrator, I can configure a Collection to show recent comments.
Comment.Type() now correctly returns the FTI title ('Comment')
[chaoflow]
* German translation updated. * German translation updated.
[juh] [juh]

View File

@ -113,7 +113,8 @@ class Comment(CatalogAware, WorkflowAware, DynamicType, Traversable,
def Type(self): def Type(self):
"""The Discussion Item content type """The Discussion Item content type
""" """
return self.portal_type ptypes = getToolByName(self, 'portal_types')
return ptypes[self.portal_type].title
# CMF's event handlers assume any IDynamicType has these :( # CMF's event handlers assume any IDynamicType has these :(

View File

@ -215,7 +215,7 @@ class CommentCatalogTest(PloneTestCase):
def test_type(self): def test_type(self):
self.assertEquals(self.comment_brain.portal_type, 'Discussion Item') self.assertEquals(self.comment_brain.portal_type, 'Discussion Item')
self.assertEquals(self.comment_brain.meta_type, 'Discussion Item') self.assertEquals(self.comment_brain.meta_type, 'Discussion Item')
self.assertEquals(self.comment_brain.Type, 'Discussion Item') self.assertEquals(self.comment_brain.Type, 'Comment')
def test_review_state(self): def test_review_state(self):
self.assertEquals(self.comment_brain.review_state, 'published') self.assertEquals(self.comment_brain.review_state, 'published')