diff --git a/addons/email_template/email_template.py b/addons/email_template/email_template.py index 5db7538d952..c20f798fbbe 100644 --- a/addons/email_template/email_template.py +++ b/addons/email_template/email_template.py @@ -23,10 +23,9 @@ import base64 import random import netsvc +import logging import re -LOGGER = netsvc.Logger() - TEMPLATE_ENGINES = [] from osv import osv, fields @@ -35,12 +34,9 @@ from tools.translate import _ try: from mako.template import Template as MakoTemplate TEMPLATE_ENGINES.append(('mako', 'Mako Templates')) -except: - LOGGER.notifyChannel( - _("Email Template"), - netsvc.LOG_WARNING, - _("Mako templates not installed") - ) +except ImportError: + logging.getLogger('init').warning("module email_template: Mako templates not installed") + try: from django.template import Context, Template as DjangoTemplate #Workaround for bug: @@ -49,12 +45,8 @@ try: settings.configure() #Workaround ends TEMPLATE_ENGINES.append(('django', 'Django Template')) -except: - LOGGER.notifyChannel( - _("Email Template"), - netsvc.LOG_WARNING, - _("Django templates not installed") - ) +except ImportError: + logging.getLogger('init').warning("module email_template: Django templates not installed") import tools import pooler