Skip to content

Deleting devices / contracts leave associations in place #106

@uck9

Description

@uck9

Plugin version

V1.1.5

NetBox version

v4.2.2

Python version

3.8

Steps to Reproduce

When devices with attached support contract associations, or contracts are deleted, the support contract associations remain, with the delete not cascaded down. This causes issues in deleting the associations manually. They should be removed when the parent object is deleted

Expected Behavior

Associations should be deleted.

Fix is to set 'on_delete' to be 'django.db.models.deletion.CASCADE' for the contract and device items in the class SupportContractAssignment in model/contracts.py

Observed Behavior

Associations remain but the associated device / contract value is set to null

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions