providers/scim: ensure scim group member isn't None (#5391)
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
parent
b058906074
commit
7b0d8f8991
|
@ -15,6 +15,7 @@ from h11 import LocalProtocolError
|
|||
from ldap3.core.exceptions import LDAPException
|
||||
from redis.exceptions import ConnectionError as RedisConnectionError
|
||||
from redis.exceptions import RedisError, ResponseError
|
||||
from requests_mock.exceptions import NoMockAddress
|
||||
from rest_framework.exceptions import APIException
|
||||
from sentry_sdk import HttpTransport
|
||||
from sentry_sdk import init as sentry_sdk_init
|
||||
|
@ -140,6 +141,8 @@ def before_send(event: dict, hint: dict) -> Optional[dict]:
|
|||
Http404,
|
||||
# AsyncIO
|
||||
CancelledError,
|
||||
# Requests
|
||||
NoMockAddress,
|
||||
)
|
||||
exc_value = None
|
||||
if "exc_info" in hint:
|
||||
|
|
|
@ -81,12 +81,15 @@ class SCIMGroupClient(SCIMClient[Group, SCIMGroupSchema]):
|
|||
|
||||
users = list(obj.users.order_by("id").values_list("id", flat=True))
|
||||
connections = SCIMUser.objects.filter(provider=self.provider, user__pk__in=users)
|
||||
members = []
|
||||
for user in connections:
|
||||
scim_group.members.append(
|
||||
members.append(
|
||||
GroupMember(
|
||||
value=user.id,
|
||||
)
|
||||
)
|
||||
if members:
|
||||
scim_group.members = members
|
||||
return scim_group
|
||||
|
||||
def _create(self, group: Group):
|
||||
|
|
Reference in a new issue