Skip to content

Local Context Data can be set to non-none falsy values #18838

@fabi125

Description

@fabi125

Deployment Type

Self-hosted

NetBox Version

v4.2.5

Python Version

3.10

Steps to Reproduce

  1. Edit a device in the UI (e.g. https://demo.netbox.dev/dcim/devices/37/)
  2. Put in 0 as the local config context and save.

Expected Behavior

Change gets rejected for not being correct JSON (like it does for any other flat values).
Config Context also correctly rejects 0 or "" values.

Observed Behavior

Change is accepted.

Image

Relevant code: https://github.com/netbox-community/netbox/blame/v4.2.5/netbox/extras/models/configs.py#L202-L206

Happy to put up a PR for this.

Metadata

Metadata

Assignees

Labels

severity: lowDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions