diff --git a/authentik/events/tasks.py b/authentik/events/tasks.py index 2918efc73..9c00860f8 100644 --- a/authentik/events/tasks.py +++ b/authentik/events/tasks.py @@ -57,10 +57,6 @@ def event_trigger_handler(event_uuid: str, trigger_name: str): LOGGER.debug("e(trigger): attempting to prevent infinite loop", trigger=trigger) return - if not trigger.group: - LOGGER.debug("e(trigger): trigger has no group", trigger=trigger) - return - LOGGER.debug("e(trigger): checking if trigger applies", trigger=trigger) try: user = User.objects.filter(pk=event.user.get("pk")).first() or get_anonymous_user() @@ -77,6 +73,10 @@ def event_trigger_handler(event_uuid: str, trigger_name: str): if not result.passing: return + if not trigger.group: + LOGGER.debug("e(trigger): trigger has no group", trigger=trigger) + return + LOGGER.debug("e(trigger): event trigger matched", trigger=trigger) # Create the notification objects for transport in trigger.transports.all(): diff --git a/website/docs/events/notifications.md b/website/docs/events/notifications.md index b11da9014..40b4c55d7 100644 --- a/website/docs/events/notifications.md +++ b/website/docs/events/notifications.md @@ -31,6 +31,10 @@ After you've created the policies to match the events you want, create a "Notifi You have to select which group the generated notification should be sent to. If left empty, the rule will be disabled. +:::info +Before authentik 2023.5, when no group is selected, policies bound to the rule are not executed. Starting with authentik 2023.5, policies are executed even when no group is selected. +::: + You also have to select which transports should be used to send the notification. A transport with the name "default-email-transport" is created by default. This transport will use the [global email configuration](../installation/docker-compose#email-configuration-optional-but-recommended).