show default group name also if workspace information exists but group names are not stored yet

git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3897 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2010-06-14 09:59:14 +00:00
parent 8a6800ff13
commit 43770d1b16

View file

@ -244,7 +244,7 @@ class ManageWorkspaceView(PermissionView):
gn = {} gn = {}
result = [dict(predicateName=pn, result = [dict(predicateName=pn,
predicateTitle=conceptManager[pn].title, predicateTitle=conceptManager[pn].title,
groupName='', groupExists=False, groupName=None, groupExists=False,
roleParent=False, roleWSI=False) roleParent=False, roleWSI=False)
for pn in apn] for pn in apn]
gfName = self.context.workspaceGroupsFolderName gfName = self.context.workspaceGroupsFolderName
@ -255,7 +255,10 @@ class ManageWorkspaceView(PermissionView):
wsiRMget = IPrincipalRoleManager(self.context).getPrincipalsForRole wsiRMget = IPrincipalRoleManager(self.context).getPrincipalsForRole
for item in result: for item in result:
pn = item['predicateName'] pn = item['predicateName']
groupName = item['groupName'] = gn.get(pn, getDefaultGroupName(pn)) groupName = gn.get(pn)
if groupName is None:
groupName = getDefaultGroupName(pn)
item['groupName'] = groupName
roleName = 'loops.' + pn.lstrip('is').title() roleName = 'loops.' + pn.lstrip('is').title()
if gf is not None and groupName in gf: if gf is not None and groupName in gf:
item['groupExists'] = True item['groupExists'] = True