Skip to content
Permalink
Browse files
Make it possible to delete broken portlet assignment.
  • Loading branch information
vipod committed Feb 23, 2013
1 parent 24037f8 commit f69fb3ff9133a281233ee06fc14fcc317fb8bc33
Showing 2 changed files with 14 additions and 0 deletions.
@@ -4,6 +4,9 @@ Changelog
2.4.2 (unreleased)
------------------

- Make it possible to delete broken portlet assignment.
[vipod]

- Make sure a portlet name is not a unicode string. This prevents problems when
trying to use a portlet name in joined strings.
[wichert]
@@ -12,6 +12,7 @@
from plone.portlets.utils import hashPortletInfo
from plone.portlets.utils import unhashPortletInfo

from zope.container import contained
from zope.interface import implements, Interface
from zope.component import adapts, getMultiAdapter, queryMultiAdapter, queryAdapter, getUtility
from zope.contentprovider.interfaces import UpdateNotCalled
@@ -403,7 +404,17 @@ def delete_portlet(self, name):
self.authorize()
assignments = aq_inner(self.context)
IPortletPermissionChecker(assignments)()

# set fixing_up to True to let zope.container.contained
# know that our object doesn't have __name__ and __parent__
fixing_up = contained.fixing_up
contained.fixing_up = True

del assignments[name]

# revert our fixing_up customization
contained.fixing_up = fixing_up

return self.finish_portlet_change()

def _nextUrl(self):

3 comments on commit f69fb3f

@mister-roboto
Copy link

@mister-roboto mister-roboto commented on f69fb3f Feb 23, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing:

@mister-roboto
Copy link

@mister-roboto mister-roboto commented on f69fb3f Feb 23, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing:

@davilima6
Copy link
Member

@davilima6 davilima6 commented on f69fb3f Feb 24, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.