Config context isn't applied if it's attached to a site and tag at the same time #9908

Closed
opened 2025-12-29 21:24:15 +01:00 by adam · 1 comment
Owner

Originally created by @notscottsmith on GitHub (Jun 26, 2024).

Deployment Type

Self-hosted

NetBox Version

v3.7.8

Python Version

3.11

Steps to Reproduce

  1. Create tag
  2. Create site
  3. Create config context with a JSON payload and attach to site and tag
  4. Create device and attach to site
  5. View device's config context (nothing should show)
  6. Detach tag from config context
  7. View device's config context again (should be there now)

This can be viewed in either the API or the UI - both yield the same results.

Expected Behavior

Config context should show up on the device regardless of whatever else it's attached to.

Observed Behavior

The config context is hidden when the object is attached to 2 or more sections

Originally created by @notscottsmith on GitHub (Jun 26, 2024). ### Deployment Type Self-hosted ### NetBox Version v3.7.8 ### Python Version 3.11 ### Steps to Reproduce 1. Create tag 2. Create site 3. Create config context with a JSON payload and attach to site and tag 4. Create device and attach to site 5. View device's config context (nothing should show) 6. Detach tag from config context 7. View device's config context again (should be there now) This can be viewed in either the API or the UI - both yield the same results. ### Expected Behavior Config context should show up on the device regardless of whatever else it's attached to. ### Observed Behavior The config context is hidden when the object is attached to 2 or more sections
adam closed this issue 2025-12-29 21:24:15 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jun 26, 2024):

Config context should show up on the device regardless of whatever else it's attached to.

This is not the intended behavior. The logic employed when collecting applicable config contexts for a device is to AND all assigned attributes.

If you would like to propose altering this behavior, please submit a feature request citing your use case, but please be aware that outright flipping the logic would not be tenable as it would break all existing deployments.

@jeremystretch commented on GitHub (Jun 26, 2024): > Config context should show up on the device regardless of whatever else it's attached to. This is not the intended behavior. The logic employed when collecting applicable config contexts for a device is to [`AND` all assigned attributes](https://github.com/netbox-community/netbox/blob/33004dfab0679547b2a33b84b39f6b96f08201ae/netbox/extras/querysets.py#L93). If you would like to propose altering this behavior, please submit a [feature request](https://github.com/netbox-community/netbox/issues/new?assignees=&labels=type%3A+feature%2Cstatus%3A+needs+triage&projects=&template=feature_request.yaml) citing your use case, but please be aware that outright flipping the logic would not be tenable as it would break all existing deployments.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9908