root/qPloneComments/tags/3.1/setuphandlers.py

Revision 1158 (checked in by deo, 6 months ago)

Added the new GS import step.

  • Property svn:eol-style set to native
Line 
1 from Products.CMFCore.utils import getToolByName
2
3 def setupVarious(context):
4     """Run the various non-Generic Setup profile import steps.
5     """
6     if context.readDataFile('qPloneComments-default.txt') is None:
7         return
8
9     portal = context.getSite()
10     logger = context.getLogger('qPloneComments')
11
12     # Add 'DiscussionManagers' group
13     gtool = getToolByName(portal, 'portal_groups')
14     existing = gtool.listGroupIds()
15     if not 'DiscussionManager' in existing:
16         gtool.addGroup('DiscussionManager', roles=['DiscussionManager'])
17         logger.info('Added DiscussionManager group to portal_groups with DiscussionManager role.')
18
19     # Remove workflow-chain for Discussion Item
20     wf_tool = getToolByName(portal, 'portal_workflow')
21     wf_tool.setChainForPortalTypes(('Discussion Item',), [])
22     logger.info('Removed workflow chain for Discussion Item type.')
Note: See TracBrowser for help on using the browser.