[CMF-checkins] CVS: CMF - PortalFolder.py:1.8

tseaver@digicool.com tseaver@digicool.com
Tue, 10 Apr 2001 00:00:06 -0400 (EDT)


Update of /cvs-repository/CMF/CMFCore
In directory korak:/tmp/cvs-serv25647/CMFCore

Modified Files:
	PortalFolder.py 
Log Message:


 - Filter type objects using 'isConstructionAllowed' in
   'PortalFolder.allowedContentTypes' (Tracker issue #249).



--- Updated File PortalFolder.py in package CMF --
--- PortalFolder.py	2001/04/08 19:18:09	1.7
+++ PortalFolder.py	2001/04/10 04:00:04	1.8
@@ -183,12 +183,14 @@
 
         if myType is not None:
             for contentType in portal_types.listTypeInfo():
-                if myType.allowType(contentType.Type()):
-                    result.append(contentType)
+                if myType.allowType( contentType.Type() ):
+                    result.append( contentType )
         else:
             result = portal_types.listTypeInfo()
 
-        return result
+        return filter( lambda typ, container=self:
+                          typ.isConstructionAllowed( container )
+                     , result )
     
     security.declareProtected(AddPortalFolders, 'manage_addPortalFolder')
     def manage_addPortalFolder(self, id, title='', REQUEST=None):