-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
attribute "last_updated" not updated when primary IP gets removed from device/virtual machine #5419
Comments
The problem here is that the disassociation of the deleted IP address is being handled at the database level: |
We could update the device model from the IPAddress model, but... This would trigger a webhook or any other defined signals. Would we want this behaviour? |
Would a database trigger be enough? |
Strictly speaking, this behavior would be required. The parent device/VM is being modified via the deletion of an assigned primary IP, so that change needs to be communicated just as if the object was being modified directly.
It would be sufficient to update the field, but not to invoke the complete change logging process (creating a change record and triggering any webhooks). I see two options:
IMO A is the preferred approach because it preserves the existing behavior, but I'm open to arguments in support of option B. |
I opt for option A as well. Option B would be prefered if this method supported a confirmation flag. If a user action is confronted with a PROTECT such as this one, it would imo be user friendly to warn, but allow for an additional confirmation that allows for the delete anyway. If this would happen option A (signaling a change on the parent device/VM) would still need to be implemented? |
Environment
Steps to Reproduce (assuming we have a VM with a assigned primary ip)
Expected Behavior
The
last_updated
attribute is set to a current time/date valueObserved Behavior
The
last_updated
attribute is still the same as from before the deletion of the primary IPNote
Adding an Primary IP updates the
last_updated
attribute correctlyExample
The text was updated successfully, but these errors were encountered: