diff --git a/authentik/lib/sentry.py b/authentik/lib/sentry.py index 70d7246ca..4f6f5c45a 100644 --- a/authentik/lib/sentry.py +++ b/authentik/lib/sentry.py @@ -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: diff --git a/authentik/providers/scim/clients/group.py b/authentik/providers/scim/clients/group.py index cd974ef4c..63eb74af2 100644 --- a/authentik/providers/scim/clients/group.py +++ b/authentik/providers/scim/clients/group.py @@ -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):