goauthentik / goauthentik/authentik
Cannot configure `authentik_events.notificationrule` transports via blueprint
- Dominant language
- Python
- Stars
- 25.6k
- Forks
- 2k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 644
Description
### Describe the bug
I am trying to create a notification transport rule via a blueprint. This looks something like this:
```yaml
- model: authentik_events.notificationrule
...
attrs:
...
transports:
- !If [!Condition [...],
!KeyOf global-email-notification-transport,
null]
- !If [!Condition [...],
!KeyOf global-local-notification-transport,
null]
```
The idea being that certain transports are only added if a given condition is met.
However, when any of the `!Conditions` resolves to `null`, the blueprint fails. As far as I can tell this is because the `transports` field of the `authentik_events.notificationrule` model does not have `null=True` set:
https://github.com/goauthentik/authentik/blob/6e91af6dfc0ed7626f0fcc1b72f7351782596de6/authentik/events/models.py#L598-L605
I _think_ this might be as easy to fix as adding `null=True` to the model field and running makemigrations.
Alternatively, perhaps the serialiser can be configured to ignore the null elements and only pass non-null ones to the model.
### How to reproduce
Apply a blueprint that sets `authentik_events.notificationrule.transports` field to a list of `null`s
### Expected behavior
Blueprint succeeds with only the non-null transports being added, the `null`s are ignored.
### Screenshots
_No response_
### Additional context
_No response_
### Deployment Method
Docker
### Version
2025.10.2
### Relevant log output
```shell
```
Contributor guide
Assessment
This issue has not been assessed yet.