diff --git a/authentik/events/api/notification_rules.py b/authentik/events/api/notification_rules.py index 8af00d09d3..a793cda476 100644 --- a/authentik/events/api/notification_rules.py +++ b/authentik/events/api/notification_rules.py @@ -11,7 +11,9 @@ from authentik.events.models import NotificationRule class NotificationRuleSerializer(ModelSerializer): """NotificationRule Serializer""" - destination_group_obj = GroupSerializer(read_only=True, source="destination_group") + destination_group_obj = GroupSerializer( + read_only=True, source="destination_group", required=False, allow_null=True + ) class Meta: model = NotificationRule diff --git a/packages/client-ts/src/models/NotificationRule.ts b/packages/client-ts/src/models/NotificationRule.ts index 89a51b5ed8..c87dafbb80 100644 --- a/packages/client-ts/src/models/NotificationRule.ts +++ b/packages/client-ts/src/models/NotificationRule.ts @@ -58,7 +58,7 @@ export interface NotificationRule { * @type {Group} * @memberof NotificationRule */ - readonly destinationGroupObj: Group; + readonly destinationGroupObj: Group | null; /** * When enabled, notification will be sent to user the user that triggered the event.When destination_group is configured, notification is sent to both. * @type {boolean} diff --git a/schema.yml b/schema.yml index 47a221c960..33583bf01a 100644 --- a/schema.yml +++ b/schema.yml @@ -43829,6 +43829,7 @@ components: allOf: - $ref: '#/components/schemas/Group' readOnly: true + nullable: true destination_event_user: type: boolean description: When enabled, notification will be sent to user the user that