You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Custom Object Type listed twice in "Related Objects" panel of the target object (e.g. Tenant) – 0.7.0 / NetBox 4.7.3 #841
Create a Custom Object Type (e.g. tstcorp_lines) with an Object field pointing to tenancy.tenant.
Create at least one custom object linked to a Tenant.
Open that Tenant's page.
Expected Behavior
The type is listed once, like any regular related model (IP addresses, VLANs, ...).
Observed Behavior
The "Related Objects" panel on the Tenant page lists the custom object type twice (two identical rows, same count). No errors in the logs. Still reproducible on 0.7.0 even though the new "Custom Objects" tab exists. Same symptom as #594 (0.5.2 / NetBox 4.6.3), which was expected to be superseded by the tab, but the legacy panel row is still duplicated.
Suspected Cause
Tenant._meta.related_objects contains the same reverse relation twice. In netbox_custom_objects/init.py, CustomObjectsPluginConfig.get_models() (around line 637 in 0.7.0) yields the dynamically generated model twice, so the app registry sees the model twice. Related: #383 (same symptom, fixed in 0.4.7), #688, #755.
Proposed Fix
Deduplicate the models yielded by get_models() (e.g. by _meta.label_lower). Alternatively, exclude custom object types from the legacy Related Objects panel now that the Custom Objects tab covers them.
Activity