Commit d0c912b3 authored by Jérome Perrin's avatar Jérome Perrin

stop accessing "context" in workflow script.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18137 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 757de78d
...@@ -3,11 +3,8 @@ ...@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<string>Products.PythonScripts.PythonScript</string> <tuple/>
<string>PythonScript</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
...@@ -70,11 +67,12 @@ ...@@ -70,11 +67,12 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>string_subject = \'Re: %s\' % state_change[\'object\'].getTitle()\n <value> <string>string_subject = \'Re: %s\' % state_change[\'object\'].getTitle()\n
message = state_change.kwargs[\'comment\']\n message = state_change.kwargs[\'comment\']\n
document = state_change[\'object\']\n
\n \n
# XXX Wrong way to get email or even to send an email\n # XXX Wrong way to get email or even to send an email\n
PersonModule_viewPersonList = context.getClientValueList(portal_type="Person") # should become getDestinationSectionList()\n PersonModule_viewPersonList = document.getClientValueList(portal_type="Person") # should become getDestinationSectionList()\n
email_list = map(lambda x:x.getDefaultEmailText(), PersonModule_viewPersonList)\n email_list = map(lambda x:x.getDefaultEmailText(), PersonModule_viewPersonList)\n
state_change[\'object\'].MailHost.send(message, mto=email_list, mfrom=context.portal_preferences.getPreferredEventSenderEmail(),\n document.MailHost.send(message, mto=email_list, mfrom=context.portal_preferences.getPreferredEventSenderEmail(),\n
subject=string_subject)\n subject=string_subject)\n
</string> </value> </string> </value>
</item> </item>
...@@ -123,10 +121,11 @@ state_change[\'object\'].MailHost.send(message, mto=email_list, mfrom=context.po ...@@ -123,10 +121,11 @@ state_change[\'object\'].MailHost.send(message, mto=email_list, mfrom=context.po
<string>_getitem_</string> <string>_getitem_</string>
<string>string_subject</string> <string>string_subject</string>
<string>message</string> <string>message</string>
<string>context</string> <string>document</string>
<string>PersonModule_viewPersonList</string> <string>PersonModule_viewPersonList</string>
<string>map</string> <string>map</string>
<string>email_list</string> <string>email_list</string>
<string>context</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
127 128
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment