Skip to content

Notifications are automatically deleted when an associated object is deleted (in some cases) #17098

@jeremystretch

Description

@jeremystretch

Deployment Type

NetBox Cloud

NetBox Version

v4.1-beta1

Python Version

3.10

Steps to Reproduce

  1. Manually create a Notification associated with an object (e.g. a site)
  2. Manually delete that object via the shell

Expected Behavior

The notification should persist, relying on the captured static representation of the object to denote the association.

Observed Behavior

The notification is deleted automatically, due to the generic relation on NotificationsMixin:

Note also, that if you delete an object that has a GenericRelation, any objects which have a GenericForeignKey pointing at it will be deleted as well.
...
Unlike ForeignKey, GenericForeignKey does not accept an on_delete argument to customize this behavior.

Metadata

Metadata

Assignees

Labels

betaConcerns a bug/feature in a beta releaseseverity: mediumResults in substantial degraded or broken functionality for specfic workflowsstatus: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions