def _sso_params(member):
 try:
  auth_provider = AuthProvider.objects.get(organization=member.organization_id)
 except AuthProvider.DoesNotExist:
  sso_is_valid = True
  requires_sso = False
 else:
  if auth_provider.flags.allow_unlinked:
   requires_sso = False
   sso_is_valid = True
  else:
   requires_sso = True
   try:
    auth_identity = AuthIdentity.objects.get(auth_provider=auth_provider, user=member.user_id)
   except AuthIdentity.DoesNotExist:
    sso_is_valid = False
   else:
    sso_is_valid = auth_identity.is_valid(member)
 return (requires_sso, sso_is_valid)

def _sso_params ( member ) : try : auth_provider = AuthProvider . objects . get ( organization = member . organization_id ) except AuthProvider . DoesNotExist : sso_is_valid = True requires_sso = False else : if auth_provider . flags . allow_unlinked : requires_sso = False sso_is_valid = True else : requires_sso = True try : auth_identity = AuthIdentity . objects . get ( auth_provider = auth_provider , user = member . user_id ) except AuthIdentity . DoesNotExist : sso_is_valid = False else : sso_is_valid = auth_identity . is_valid ( member ) return ( requires_sso , sso_is_valid )
return a tuple of for a given member .