default parent address was broken in schemaeditor

This commit is contained in:
Thomas Desvenain 2013-09-26 12:00:15 +02:00
parent 9f1fb0891e
commit 4a7b163d2c
1 changed files with 8 additions and 2 deletions

View File

@ -235,9 +235,15 @@ def default_use_parent_address(adapter):
except AttributeError:
return False
if adapter.view._parent.portal_type == 'person':
try:
parent_type = parent.portal_type
except:
# in schema editor
return False
elif adapter.view._parent.portal_type == 'organization' \
if parent_type == 'person':
return False
elif parent_type == 'organization' \
and IDirectory.providedBy(adapter.context):
return False
else: