avoid variable name 'id'

This commit is contained in:
Helmut Merz 2025-05-07 18:28:21 +02:00
parent a72553c2de
commit 6a0a0841a1

View file

@ -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