source: products/qPloneComments/tags/3.1.1/setuphandlers.py @ 1591

Last change on this file since 1591 was 119, checked in by chervol, 18 years ago

global fixup

  • Property svn:eol-style set to native
File size: 885 bytes
Line 
1from Products.CMFCore.utils import getToolByName
2
3def 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 repository browser.