Related object links from sites to circuit termination not working #10993

Closed
opened 2025-12-29 21:38:55 +01:00 by adam · 3 comments
Owner

Originally created by @corubba on GitHub (Apr 8, 2025).

Originally assigned to: @corubba on GitHub.

Deployment Type

Self-hosted

NetBox Version

v4.2.6 (also reproduced it on main branch)

Python Version

3.12

Steps to Reproduce

All steps are done using the web ui in a webbrowser.

  1. Add a new Region named My Region
  2. Add a new Site named My Site
  3. Add a new Circuit Provider named My Circuit Provider
  4. Add a new Circuit Type named My Circuit Type
  5. Add a new Circuit with Circuit ID My Circuit; with Provider My Circuit Provider and Circuit Type My Circuit Type
  6. Add a new Circuit Termination for Circuit My Circuit; with Termination side A, Termination Type DCIM > Region and Termination/Region My Region
  7. Add a new Circuit Termination for Circuit My Circuit; with Termination side Z, Termination Type DCIM > Site and Termination/Site My Site
  8. Open the detail page for the Site My Site (url would be something like /dcim/sites/1/)
  9. Open the detail page for the Region My Region (url would be something like /dcim/regions/1/)
  10. In the Related objects panel on the right side, click the Circuit Terminations link

Expected Behavior

Regarding step 8: The Related objects panel on the right side of the Site detail page contains a Circuit Terminations link, like it is for Region/SiteGroup/Location.

Regarding step 10: The Circuit Termination list page is shown, with filter Region: My Region applied, and only showing entries that are terminated at that region (My Circuit Termination side A from the example above, but not My Circuit Termination side Z).

Observed Behavior

Regarding step 8: The Related objects panel on the right side of the Site detail page does not contain a Circuit Terminations link.

Regarding step 10: The Circuit Termination list page is shown, with no filter applied, and showing all entries. This is (to the best of my knowledge) caused by the link on the detail page pointing to /circuits/circuit-terminations/?_region_id=1 (which is the cached property), but should be /circuits/circuit-terminations/?region_id=1 (without the leading underscore). The Circuit Terminations link on the detail page of SiteGroups and Locations also contain that leading underscore, and are not working as well.


I am willing to work on this. I would be grateful for any (rough) pointers where to start looking and/or what automatism is at work here.
Originally created by @corubba on GitHub (Apr 8, 2025). Originally assigned to: @corubba on GitHub. ### Deployment Type Self-hosted ### NetBox Version v4.2.6 (also reproduced it on `main` branch) ### Python Version 3.12 ### Steps to Reproduce All steps are done using the web ui in a webbrowser. 1. Add a new Region named `My Region` 1. Add a new Site named `My Site` 1. Add a new Circuit Provider named `My Circuit Provider` 1. Add a new Circuit Type named `My Circuit Type` 1. Add a new Circuit with Circuit ID `My Circuit`; with Provider `My Circuit Provider` and Circuit Type `My Circuit Type` 1. Add a new Circuit Termination for Circuit `My Circuit`; with Termination side `A`, Termination Type `DCIM > Region` and Termination/Region `My Region` 1. Add a new Circuit Termination for Circuit `My Circuit`; with Termination side `Z`, Termination Type `DCIM > Site` and Termination/Site `My Site` 1. Open the detail page for the Site `My Site` (url would be something like `/dcim/sites/1/`) 1. Open the detail page for the Region `My Region` (url would be something like `/dcim/regions/1/`) 1. In the `Related objects` panel on the right side, click the `Circuit Terminations` link ### Expected Behavior Regarding step 8: The `Related objects` panel on the right side of the Site detail page contains a `Circuit Terminations` link, like it is for Region/SiteGroup/Location. Regarding step 10: The Circuit Termination list page is shown, with filter `Region: My Region` applied, and only showing entries that are terminated at that region (`My Circuit` Termination side `A` from the example above, but not `My Circuit` Termination side `Z`). ### Observed Behavior Regarding step 8: The `Related objects` panel on the right side of the Site detail page does not contain a `Circuit Terminations` link. Regarding step 10: The Circuit Termination list page is shown, with no filter applied, and showing all entries. This is (to the best of my knowledge) caused by the link on the detail page pointing to `/circuits/circuit-terminations/?_region_id=1` (which is the cached property), but should be `/circuits/circuit-terminations/?region_id=1` (without the leading underscore). The `Circuit Terminations` link on the detail page of SiteGroups and Locations also contain that leading underscore, and are not working as well. <hr> I am willing to work on this. I would be grateful for any (rough) pointers where to start looking and/or what automatism is at work here.
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 21:38:55 +01:00
adam closed this issue 2025-12-29 21:38:55 +01:00
Author
Owner

@bctiemann commented on GitHub (Apr 8, 2025):

Thanks @corubba ! You'll find the logic for populating the "Related Objects" table in the detail views in get_extra_context function on the relevant View class:

2207ea1a32/netbox/dcim/views.py (L229-L257)

@bctiemann commented on GitHub (Apr 8, 2025): Thanks @corubba ! You'll find the logic for populating the "Related Objects" table in the detail views in `get_extra_context` function on the relevant View class: https://github.com/netbox-community/netbox/blob/2207ea1a325e9b5a2e855fafadafa8b2d380a2e9/netbox/dcim/views.py#L229-L257
Author
Owner

@renatoalmeidaoliveira commented on GitHub (Apr 8, 2025):

Hello @corubba, I'm already dealing with Related Object on #18932, I can double check for Circuit Terminations too.

@renatoalmeidaoliveira commented on GitHub (Apr 8, 2025): Hello @corubba, I'm already dealing with `Related Object` on #18932, I can double check for `Circuit Terminations` too.
Author
Owner

@bctiemann commented on GitHub (Apr 8, 2025):

Thanks @renatoalmeidaoliveira -- I'll close this issue as a duplicate, and @corubba you may want to monitor #18932 to make sure the solution addresses your issue.

@bctiemann commented on GitHub (Apr 8, 2025): Thanks @renatoalmeidaoliveira -- I'll close this issue as a duplicate, and @corubba you may want to monitor #18932 to make sure the solution addresses your issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10993