Skip to content

Commit

Permalink
Objects without getImmediatelyAddableTypes are not supported.
Browse files Browse the repository at this point in the history
  • Loading branch information
jone committed Jan 31, 2013
1 parent 439b40a commit ce4edea
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ftw/contenttemplates/browser/create_from_template.py
@@ -1,5 +1,6 @@
from Products.CMFCore.utils import getToolByName
from Products.CMFPlone.interfaces.siteroot import IPloneSiteRoot
from Products.CMFPlone.utils import base_hasattr
from Products.Five.browser import BrowserView
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from Products.statusmessages.interfaces import IStatusMessage
Expand Down Expand Up @@ -55,6 +56,9 @@ def templates(self):
if IPloneSiteRoot.providedBy(self.context):
return []

if not base_hasattr(self.context, 'getImmediatelyAddableTypes'):
return []

portal = getToolByName(self.context, 'portal_url').getPortalObject()
catalog = getToolByName(self.context, 'portal_catalog')
return catalog(
Expand Down

0 comments on commit ce4edea

Please sign in to comment.