Please give a concise description of the bug
Attempting to delete a device in the UI fails after it has been onboarded via CMP due to protected device foreign key on CmpTransactionModel (django.db.models.deletion.ProtectedError: ("Cannot delete some instances of model 'DeviceModel' because they are referenced through protected foreign keys: 'CmpTransactionModel.device'.")
What are the steps to reproduce the issue?
Onboard a device via CMP (e.g. with signature based protection, AOKI)
What behavior did you expect?
All associated credentials are revoked and the device is deleted
Which version does the issue occur in?
0.6.0dev / latest main
Optional notes and context
Do we need to keep a CmpTransactionModel indefinitely? Only until finalized? What if an onboarding fails in the middle of a CMP transaction and we want to clean up the associated device model.
Proposal: Cascade deletion of the CmpTransactionModel if associated device is deleted (check for side effects first!)
Please give a concise description of the bug
Attempting to delete a device in the UI fails after it has been onboarded via CMP due to protected
deviceforeign key onCmpTransactionModel(django.db.models.deletion.ProtectedError: ("Cannot delete some instances of model 'DeviceModel' because they are referenced through protected foreign keys: 'CmpTransactionModel.device'.")What are the steps to reproduce the issue?
Onboard a device via CMP (e.g. with signature based protection, AOKI)
What behavior did you expect?
All associated credentials are revoked and the device is deleted
Which version does the issue occur in?
0.6.0dev / latest main
Optional notes and context
Do we need to keep a CmpTransactionModel indefinitely? Only until finalized? What if an onboarding fails in the middle of a CMP transaction and we want to clean up the associated device model.
Proposal: Cascade deletion of the CmpTransactionModel if associated device is deleted (check for side effects first!)