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