21390 skip m2m processing for internal models to avoid extraneous ObectChange records #361

Closed
opened 2026-04-05 16:27:25 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @arthanson on 2/12/2026

Fixes: #21390

Issue is from CablePath and it having a SET_NULL on the FK relationship which in the handle_deleted_object m2m processing causes a save to the related object, but it has already been handled by Django. CablePath is an internal model and for those (_netbox_private = True) models the m2m processing should probably be skipped.

Skips the m2m handling in handle_deleted_object Django's on_delete handlers already take care of the database integrity. This appears to only effect CablePath as other _netbox_private models - CablePath is the only _netbox_private model that has reverse FK relationships from ChangeLoggingMixin models with on_delete=SET_NULL.

*Originally created by @arthanson on 2/12/2026* ### Fixes: #21390 Issue is from CablePath and it having a SET_NULL on the FK relationship which in the `handle_deleted_object` m2m processing causes a save to the related object, but it has already been handled by Django. CablePath is an internal model and for those (_netbox_private = True) models the m2m processing should probably be skipped. Skips the m2m handling in `handle_deleted_object` Django's on_delete handlers already take care of the database integrity. This appears to only effect CablePath as other _netbox_private models - CablePath is the only _netbox_private model that has reverse FK relationships from ChangeLoggingMixin models with on_delete=SET_NULL.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#361