Commit 52b4ee5f authored by Jérome Perrin's avatar Jérome Perrin

define FileUpload in utils, because it's already defined in many places


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17200 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b130c858
...@@ -34,6 +34,16 @@ import os ...@@ -34,6 +34,16 @@ import os
import Products.ERP5Type import Products.ERP5Type
from Products.MailHost.MailHost import MailHost from Products.MailHost.MailHost import MailHost
class FileUpload(file):
"""Act as an uploaded file.
"""
__allow_access_to_unprotected_subobjects__ = 1
def __init__(self, path, name):
self.filename = name
file.__init__(self, path)
self.headers = {}
# dummy objects # dummy objects
class DummyMailHost(MailHost): class DummyMailHost(MailHost):
"""Dummy Mail Host that doesn't really send messages and keep a copy in """Dummy Mail Host that doesn't really send messages and keep a copy in
...@@ -135,6 +145,7 @@ class reindex(object): ...@@ -135,6 +145,7 @@ class reindex(object):
def __call__(self, *args, **kw): def __call__(self, *args, **kw):
ret = self._func(self._instance, *args, **kw) ret = self._func(self._instance, *args, **kw)
if kw.get('reindex', 1):
get_transaction().commit() get_transaction().commit()
self._instance.tic() self._instance.tic()
return ret return ret
......
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