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