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:
Alin Voinea
2014-04-18 16:33:12 +03:00
parent 4343197209
commit 14d4382ca6
4 changed files with 12 additions and 292 deletions
+2 -1
View File
@@ -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)