Commit ddba36c9 authored by Julien Muchembled's avatar Julien Muchembled

Patch MailHost to not send emails in tpc_finish on recent Zope

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@45325 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1981d06c
...@@ -55,6 +55,7 @@ from Products.ERP5Type.patches import OFSUninstalled ...@@ -55,6 +55,7 @@ from Products.ERP5Type.patches import OFSUninstalled
from Products.ERP5Type.patches import PersistentMapping from Products.ERP5Type.patches import PersistentMapping
from Products.ERP5Type.patches import DateTimePatch from Products.ERP5Type.patches import DateTimePatch
from Products.ERP5Type.patches import PythonScript from Products.ERP5Type.patches import PythonScript
from Products.ERP5Type.patches import MailHost
from Products.ERP5Type.patches import MailTemplates from Products.ERP5Type.patches import MailTemplates
from Products.ERP5Type.patches import http_server from Products.ERP5Type.patches import http_server
from Products.ERP5Type.patches import memcache_client from Products.ERP5Type.patches import memcache_client
......
##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
# Copyright (c) 2011 Nexedi SARL and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""
Change default behaviour of MailHost to send mails immediately.
In ERP5, we have Activity Tool to postpone mail delivery.
"""
from inspect import getargspec, isfunction
from Products.MailHost.MailHost import MailBase
for f in MailBase.__dict__.itervalues():
if isfunction(f):
args, _, _, defaults = getargspec(f)
try:
i = args.index('immediate') - len(args)
except ValueError:
continue
f.func_defaults = defaults[:i] + (True,) + defaults[i+1:]
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