Author: jmorliaguet Date: Fri Jun 30 10:07:19 2006 New Revision: 3572 Modified: cpsskins/branches/paris-sprint-2006/browser/tree/slot.py cpsskins/branches/paris-sprint-2006/ui/screens/common/views.py
Log: - moved the removeSecurityProxy call to the view Modified: cpsskins/branches/paris-sprint-2006/browser/tree/slot.py ============================================================================== --- cpsskins/branches/paris-sprint-2006/browser/tree/slot.py (original) +++ cpsskins/branches/paris-sprint-2006/browser/tree/slot.py Fri Jun 30 10:07:19 2006 @@ -126,16 +126,13 @@ def move(self, content): request = self.request - content = removeSecurityProxy(content) src_container = getParent(content) - # FIXME: shouldn't have to removeSecurityProxy() - dest_container = removeSecurityProxy(self.context) + dest_container = self.context if dest_container == src_container: return content # the element is not physically moved but slot -> portlet relations # need to be updated. - relations = getRelationStorage(content) # TODO: let compound predicates support predicates of different arities @@ -156,8 +153,10 @@ first=dest_container, second=content, third=perspective) relations.add(relation) + # remove old src_slot -> portlet relations relations.remove(old_relations) + # set the portlet's parent explicitly locate(object=content, parent=dest_container) return content Modified: cpsskins/branches/paris-sprint-2006/ui/screens/common/views.py ============================================================================== --- cpsskins/branches/paris-sprint-2006/ui/screens/common/views.py (original) +++ cpsskins/branches/paris-sprint-2006/ui/screens/common/views.py Fri Jun 30 10:07:19 2006 @@ -404,8 +404,11 @@ """ request = self.request src_element = self.tmutil.getElementById(src_id) + src_element = removeSecurityProxy(src_element) src_container = getParent(src_element) dest_element = self.tmutil.getElementById(dest_id) + dest_element = removeSecurityProxy(dest_element) + if not IInnerNode.providedBy(dest_element): raise TypeError("The destination element is not a container") -- http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins