avoid variable name 'id'
This commit is contained in:
parent
a72553c2de
commit
6a0a0841a1
1 changed files with 4 additions and 4 deletions
|
@ -84,16 +84,16 @@ def getInternalPrincipal(id, context=None, pau=None):
|
||||||
raise PrincipalLookupError(id)
|
raise PrincipalLookupError(id)
|
||||||
|
|
||||||
|
|
||||||
def getPrincipalForUserId(id, context=None, auth=None):
|
def getPrincipalForUserId(userId, context=None, auth=None):
|
||||||
if not id:
|
if not userId:
|
||||||
return None
|
return None
|
||||||
if auth is None:
|
if auth is None:
|
||||||
auth = component.getUtility(IAuthentication, context=context)
|
auth = component.getUtility(IAuthentication, context=context)
|
||||||
try:
|
try:
|
||||||
return auth.getPrincipal(id)
|
return auth.getPrincipal(userId)
|
||||||
except PrincipalLookupError:
|
except PrincipalLookupError:
|
||||||
from scopes.web.auth import oidc
|
from scopes.web.auth import oidc
|
||||||
return oidc.Principal(id, dict(name=id))
|
return oidc.Principal(userId, dict(name=userId))
|
||||||
#return None
|
#return None
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue