Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion netbox/extras/models/notifications.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from functools import cached_property

from django.conf import settings
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation
from django.core.exceptions import ValidationError
from django.db import models
from django.urls import reverse
Expand Down Expand Up @@ -144,6 +144,12 @@ class NotificationGroup(ChangeLoggedModel):
blank=True,
related_name='notification_groups'
)
event_rules = GenericRelation(
to='extras.EventRule',
content_type_field='action_object_type',
object_id_field='action_object_id',
related_query_name='+'
)

objects = RestrictedQuerySet.as_manager()

Expand Down