Skip to content

Commit

Permalink
fix: duplicate aq_base w/o using Aqcuistion API resulted in an Attrib…
Browse files Browse the repository at this point in the history
…uteError that was masqued in the calling hasattr and resulted in wrong conclusion.
  • Loading branch information
jensens committed Jan 18, 2016
1 parent 5101830 commit a47e7f1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 3 additions & 1 deletion CHANGES.rst
Expand Up @@ -11,7 +11,9 @@ New:

Fixes:

- *add item here*
- Fix: duplicate aq_base w/o using Aqcuistion API resulted in an AttributeError
that was masqued in the calling hasattr and resulted in wrong conclusion.
[jensens]


2.3.7 (2016-01-08)
Expand Down
9 changes: 5 additions & 4 deletions plone/dexterity/filerepresentation.py
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
from Acquisition import aq_base, Implicit
from Products.CMFCore.utils import getToolByName
from ZPublisher.Iterators import IStreamIterator
from Acquisition import aq_base
from Acquisition import Implicit
from email.generator import Generator
from email.message import Message
from email.parser import FeedParser
Expand All @@ -13,6 +12,7 @@
from plone.rfc822 import constructMessageFromSchemata
from plone.rfc822 import initializeObjectFromSchemata
from plone.rfc822.interfaces import IPrimaryField
from Products.CMFCore.utils import getToolByName
from webdav.Resource import Resource
from zExceptions import MethodNotAllowed
from zExceptions import Unauthorized
Expand All @@ -28,6 +28,7 @@
from zope.lifecycleevent import modified, ObjectCreatedEvent
from zope.schema import getFieldsInOrder
from zope.size.interfaces import ISized
from ZPublisher.Iterators import IStreamIterator
import tempfile


Expand Down Expand Up @@ -233,7 +234,7 @@ def __getattr__(self, name):
"""Fall back on parent for certain things, even if we're aq_base'd.
This makes propertysheet access work.
"""
if hasattr(self.__parent__.aq_base, name):
if hasattr(aq_base(self.__parent__), name):
return getattr(self.__parent__, name)
raise AttributeError(name)

Expand Down

0 comments on commit a47e7f1

Please sign in to comment.