Commit 2e139aec authored by Jérome Perrin's avatar Jérome Perrin

Replace deprecated text_format accessors by content_type

parent fc1b9d74
......@@ -54,7 +54,7 @@
\n
This script is here so that we can easily customized depending on the context event, ticket or user preferences.\n
"""\n
return context.getTextFormat()\\\n
return context.getContentType()\\\n
or context.getPortalObject().portal_preferences.getPreferredTextFormat()\n
</string> </value>
</item>
......
......@@ -68,9 +68,9 @@ substitution_method_parameter_dict.setdefault(\'event_value\', context)\n
\n
\n
if notification_message is not None:\n
context.setTextFormat(notification_message.getTextFormat())\n
context.setContentType(notification_message.getContentType())\n
target_format = "txt"\n
if context.getTextFormat() == \'text/html\':\n
if context.getContentType() == \'text/html\':\n
target_format = "html"\n
mime, text_content = notification_message.convert(target_format,\n
substitution_method_parameter_dict=substitution_method_parameter_dict)\n
......
......@@ -306,7 +306,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:(here.hasFile() or here.getTextFormat() == \'text/html\') and \'page\' or \'\'</string> </value>
<value> <string>python:(here.hasFile() or here.getContentType() == \'text/html\') and \'page\' or \'\'</string> </value>
</item>
</dictionary>
</pickle>
......@@ -338,7 +338,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:(here.getTextFormat() == \'text/html\' and here.portal_preferences.getPreferredTextEditor()) or \'text_area\'</string> </value>
<value> <string>python:(here.getContentType() == \'text/html\' and here.portal_preferences.getPreferredTextEditor()) or \'text_area\'</string> </value>
</item>
</dictionary>
</pickle>
......
695
\ No newline at end of file
696
\ No newline at end of file
......@@ -298,7 +298,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:(here.getTextFormat() == \'text/html\' and here.portal_preferences.getPreferredTextEditor()) or \'text_area\'</string> </value>
<value> <string>python:(here.getContentType() == \'text/html\' and here.portal_preferences.getPreferredTextEditor()) or \'text_area\'</string> </value>
</item>
</dictionary>
</pickle>
......
147
\ No newline at end of file
148
\ No newline at end of file
......@@ -364,7 +364,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:(here.getTextFormat() == \'text/html\' and here.portal_preferences.getPreferredTextEditor()) or \'text_area\'</string> </value>
<value> <string>python:(here.getContentType() == \'text/html\' and here.portal_preferences.getPreferredTextEditor()) or \'text_area\'</string> </value>
</item>
</dictionary>
</pickle>
......
942
\ No newline at end of file
943
\ No newline at end of file
......@@ -515,7 +515,7 @@ class TestCRM(BaseTestCRM):
self.assertEqual(destination_list, [first_user])
mail_message = event_list[0]
self.assertEqual(sender.getRelativeUrl(), mail_message.getSource())
self.assertEqual(mail_message.getTextFormat(), "text/html")
self.assertEqual(mail_message.getContentType(), "text/html")
self.assertEqual(mail_message.getTextContent(), "Hello %s" % first_user.getTitle())
self.assertEqual(mail_message.getResourceValue(), service)
......
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