Use commented object as context instead of comment within event trigger
- In order this to work with plone.contentrules use commented object as the main context within custom discussion events and add comment as the second parameter.
This commit is contained in:
@@ -12,8 +12,9 @@ class DiscussionEvent(object):
|
||||
"""
|
||||
implements(IDiscussionEvent)
|
||||
|
||||
def __init__(self, context, **kwargs):
|
||||
def __init__(self, context, comment, **kwargs):
|
||||
self.object = context
|
||||
self.comment = comment
|
||||
for key, value in kwargs.items():
|
||||
setattr(self, key, value)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user