Commit e004cec6 authored by Julien Muchembled's avatar Julien Muchembled

TemplateTool: do not fail if filter is missing

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40072 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 34b1bfc7
...@@ -56,7 +56,7 @@ import cPickle ...@@ -56,7 +56,7 @@ import cPickle
import posixpath import posixpath
from base64 import b64encode, b64decode from base64 import b64encode, b64decode
from Products.ERP5Type.Message import translateString from Products.ERP5Type.Message import translateString
from zLOG import LOG, INFO from zLOG import LOG, INFO, WARNING
from base64 import decodestring from base64 import decodestring
import subprocess import subprocess
...@@ -637,9 +637,14 @@ class TemplateTool (BaseTool): ...@@ -637,9 +637,14 @@ class TemplateTool (BaseTool):
# inconsistent, the called method should not return None when # inconsistent, the called method should not return None when
# nothing is selected # nothing is selected
portal = self.getPortalObject() portal = self.getPortalObject()
script_id_list = portal.portal_preferences\ script_list = []
.getPreferredDiffFilterScriptIdList() or () for script_id in portal.portal_preferences\
return [getattr(portal, x) for x in script_id_list] .getPreferredDiffFilterScriptIdList() or ():
try:
script_list.append(getattr(portal, script_id))
except AttributeError:
LOG("TemplateTool", WARNING, "Unable to find %r script" % script_id)
return script_list
def getFilteredDiffAsHTML(self, diff): def getFilteredDiffAsHTML(self, diff):
""" """
......
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