Changeset 1919 for trunk/LeMillTool.py


Ignore:
Timestamp:
08/08/07 01:48:48 (12 years ago)
Author:
jukka
Message:

Refactored groups to not use portal_groups. Things should be faster and users from weird sources shouldn't cause so much problems. Not much tested yet, but archetype update and quickinstaller reinstall works fine.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LeMillTool.py

    r1905 r1919  
    5959    security.declarePublic('createUniqueGroupId') 
    6060    def createUniqueGroupId(self, basename): 
    61         #Groups should always use titles for display, but urls use ids so lets make ids understandable & unique. 
    62         # basename should be user's id or material's id, we add _group+numbers after that.  
     61        #Groups should always use titles for display, but we have to start from something 
    6362        basename=str(basename) 
    64         grouptool=getToolByName(self, 'portal_groups') 
    65         folder=grouptool.getGroupWorkspacesFolder() 
    6663        name=basename+'_group' 
    6764        number=1 
    68         while name in folder.objectIds(): 
     65        folder=self.community 
     66        while hasattr(folder, name): 
    6967            name=basename+'_group'+str(number) 
    7068            number=number+1 
Note: See TracChangeset for help on using the changeset viewer.