Hi,

I have the following code in side a Plone app. The intent of this method is to perform a logging of changed Archetype fields. This code basically works but under some unknown circumstances I get error below where the transaction module seems to be None?! There is no product refreshing enabled. I am using Zope 2.8.5....any ideas?

Andreas

--------


import transaction

def post_validate(self, REQUEST, errors):
   """ hook into AT(CT) to intercept edit operations to provide
       logging for changed data.
   """

   T = transaction.get()
   CH = CommitHandler()
   CH.setInstance(self)
   T.beforeCommitHook(CH)

   return self._post_validate(REQUEST, errors)


--------

File "/develop/sandboxes/plone2.1/Zope/lib/python/Shared/DC/Scripts/Bindings.py", line 311, in __call__
   return self._bindAndExec(args, kw, None)
File "/develop/sandboxes/plone2.1/Zope/lib/python/Shared/DC/Scripts/Bindings.py", line 348, in _bindAndExec
   return self._exec(bound_data, args, kw)
File "/develop/sandboxes/plone2.1/instance/Products/CMFCore/FSPythonScript.py", line 163, in _exec
   result = f(*args, **kw)
 File "Script (Python)", line 23, in validate_atct
File "/develop/sandboxes/plone2.1/instance/Products/Archetypes/BaseObject.py", line 504, in validate
   self.post_validate(REQUEST, errors)
File "/develop/sandboxes/plone2.1/instance/Products/SRMedia/monkeypatches.py", line 72, in post_validate
   return self._post_validate(REQUEST, errors)
File "/develop/sandboxes/plone2.1/instance/Products/SRMedia/monkeypatches.py", line 67, in post_validate
   T = transaction.get()
AttributeError: 'NoneType' object has no attribute 'get'

Attachment: pgpMeL9ObLPeE.pgp
Description: PGP signature

_______________________________________________
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev

Reply via email to