Commit c3b89cf6 authored by Hanno Schlichting's avatar Hanno Schlichting

Avoid checking for aq_parent as an attribute

parent 966fde8b
...@@ -74,26 +74,27 @@ class UndoSupport(ExtensionClass.Base): ...@@ -74,26 +74,27 @@ class UndoSupport(ExtensionClass.Base):
PrincipiaUndoBatchSize=None): PrincipiaUndoBatchSize=None):
if first_transaction is None: if first_transaction is None:
first_transaction=self.get_request_var_or_attr( first_transaction = self.get_request_var_or_attr(
'first_transaction', 0) 'first_transaction', 0)
if PrincipiaUndoBatchSize is None: if PrincipiaUndoBatchSize is None:
PrincipiaUndoBatchSize=self.get_request_var_or_attr( PrincipiaUndoBatchSize = self.get_request_var_or_attr(
'PrincipiaUndoBatchSize', 20) 'PrincipiaUndoBatchSize', 20)
if last_transaction is None: if last_transaction is None:
last_transaction=self.get_request_var_or_attr( last_transaction = self.get_request_var_or_attr(
'last_transaction', 'last_transaction',
first_transaction+PrincipiaUndoBatchSize) first_transaction+PrincipiaUndoBatchSize)
spec={} spec = {}
# A user is allowed to undo transactions that were initiated # A user is allowed to undo transactions that were initiated
# by any member of a user folder in the place where the user # by any member of a user folder in the place where the user
# is defined. # is defined.
user = getSecurityManager().getUser() user = getSecurityManager().getUser()
if hasattr(user, 'aq_parent'): user_parent = aq_parent(user)
path = '/'.join(user.aq_parent.getPhysicalPath()[1:-1]) if user_parent is not None:
path = '/'.join(user_parent.getPhysicalPath()[1:-1])
else: else:
path = '' path = ''
if path: if path:
......
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