netbox-lifecycle
netbox-lifecycle copied to clipboard
Deleting devices / contracts leave associations in place
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