Commit ba9baeb7 authored by Arnaud Fontaine's avatar Arnaud Fontaine

ZODB Components: Preparation of erp5_base migration from FS: Fix pylint...

ZODB Components: Preparation of erp5_base migration from FS: Fix pylint undefined-variable errors: get_transaction() removed in ZODB 3.6.
parent 2c8868fe
......@@ -463,7 +463,7 @@ class ZoomifyZopeProcessor(ZoomifyBase):
#import Zope
#app = Zope.app()
#get_transaction().begin()
#transaction.manager.begin()
self._process()
#app._p_jar.close()
#del app
......
......@@ -230,7 +230,8 @@ class Coordinate(Base):
RESPONSE.setStatus(204)
return RESPONSE
except ResourceLockedError:
get_transaction().abort()
import transaction
transaction.abort()
RESPONSE.setStatus(423)
return RESPONSE
......
......@@ -2,6 +2,7 @@ def clearData(self,REQUEST=None):
"""
this allows to erase every data object
"""
import transaction
context=self
for folder in context.objectValues(("ERP5 Folder",)):
print "#### Deleting inside the folder %s ####" % folder.id
......@@ -11,6 +12,6 @@ def clearData(self,REQUEST=None):
for id in to_delete_list:
folder.manage_delObjects(id)
to_delete_list = folder.objectIds()
get_transaction().commit()
transaction.commit()
print "work done"
......@@ -128,6 +128,7 @@ class TestTaskMixin:
# portal = self.getPortal()
# uf = portal.acl_users
# if not uf.getUserById('dummy'):
# import transaction
# uf._doAddUser('manager', '', ['Manager'], [])
# self.loginByUserName('manager')
# person_module = portal.getDefaultModule(self.person_portal_type)
......@@ -141,7 +142,7 @@ class TestTaskMixin:
# start_date='1980-01-01',
# stop_date='2099-12-31')
# assignment.open()
# get_transaction().commit()
# transaction.commit()
# self.tic()
# module_list = []
# portal_type_list = []
......@@ -164,7 +165,7 @@ class TestTaskMixin:
# '')
# ti.updateRoleMapping()
#
# get_transaction().commit()
# transaction.commit()
# self.tic()
# portal.portal_caches.clearAllCache()
#
......
......@@ -6,6 +6,7 @@ LDAP Entry Objects
__version__ = "$Revision: 1.13 $"[11:-2]
import Acquisition, AccessControl, OFS, string
import transaction
from App.special_dtml import HTMLFile
from App.Dialogs import MessageDialog
import ldap, urllib, UserList
......@@ -296,7 +297,7 @@ class TransactionalEntry(GenericEntry): #Acquisition.Implicit
self._data={}
self._isNew=isNew
if isNew:
get_transaction().register(self)
transaction.get().register(self)
self._registered=1
self._isDeleted=0 #deletion flag
self._clearSubentries()
......@@ -312,7 +313,7 @@ class TransactionalEntry(GenericEntry): #Acquisition.Implicit
is called.
"""
if not self._registered:
get_transaction().register(self)
transaction.get().register(self)
self._registered=1
kwdict.update(kw)
......@@ -330,7 +331,7 @@ class TransactionalEntry(GenericEntry): #Acquisition.Implicit
Unset (delete) an attribute
"""
if not self._registered:
get_transaction().register(self)
transaction.get().register(self)
self._registered=1
if type(attr) is type(''):
......@@ -371,7 +372,7 @@ class TransactionalEntry(GenericEntry): #Acquisition.Implicit
c._registerDelete(o.dn)
o._isDeleted=1
if not o._registered:
get_transaction().register(o)
transaction.get().register(o)
o._registered=1
del self._subentries()[o.id]
......
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