Always set the effective date of a comment to the same value as the creation date.
svn path=/plone.app.discussion/trunk/; revision=46019
This commit is contained in:
parent
b26d5a5a62
commit
f0cecaf274
@ -4,6 +4,10 @@ Changelog
|
||||
1.0RC1 (unreleased)
|
||||
-------------------
|
||||
|
||||
- Always set the effective date of a comment to the same value as the creation
|
||||
date.
|
||||
[timo]
|
||||
|
||||
- Fix SMTP exception when an email is send to the moderator.
|
||||
[timo]
|
||||
|
||||
|
@ -90,8 +90,12 @@ def in_response_to(object):
|
||||
@indexer(IComment)
|
||||
def effective(object):
|
||||
# the catalog index needs Zope DateTime instead of Python datetime
|
||||
# Todo!!!
|
||||
return DateTime
|
||||
return DateTime(object.creation_date.year,
|
||||
object.creation_date.month,
|
||||
object.creation_date.day,
|
||||
object.creation_date.hour,
|
||||
object.creation_date.minute,
|
||||
object.creation_date.second)
|
||||
|
||||
@indexer(IComment)
|
||||
def created(object):
|
||||
|
@ -151,6 +151,8 @@ class CommentIndexersTest(PloneTestCase):
|
||||
# Test if created, modified, effective etc. are set correctly
|
||||
self.assertEquals(catalog.created(self.comment)(),
|
||||
DateTime(2006, 9, 17, 14, 18, 12))
|
||||
self.assertEquals(catalog.effective(self.comment)(),
|
||||
DateTime(2006, 9, 17, 14, 18, 12))
|
||||
self.assertEquals(catalog.modified(self.comment)(),
|
||||
DateTime(2008, 3, 12, 7, 32, 52))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user