check if principal exists before adding to group
This commit is contained in:
parent
34c9d24ffa
commit
aab2d6c955
1 changed files with 6 additions and 5 deletions
|
@ -44,7 +44,7 @@ from loops.interfaces import ILoops
|
|||
from loops.organize.auth import IPersonBasedAuthenticator
|
||||
from loops.organize.interfaces import IMemberRegistrationManager
|
||||
from loops.organize.util import getPrincipalFolder, getGroupsFolder
|
||||
from loops.organize.util import getInternalPrincipal
|
||||
from loops.organize.util import getInternalPrincipal, getPrincipalForUserId
|
||||
from loops.type import getOptionsDict
|
||||
from loops.util import _
|
||||
|
||||
|
@ -130,7 +130,8 @@ class MemberRegistrationManager(object):
|
|||
group = gFolder.get(gName)
|
||||
if group is not None:
|
||||
members = [p for p in group.principals
|
||||
if self.checkPrincipalId(p)]
|
||||
if self.checkPrincipalId(p)
|
||||
and getPrincipalForUserId(p) is not None]
|
||||
members.append(pFolder.prefix + userId)
|
||||
group.principals = members
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue