Skip to content

Escaped colon in custom field choice is not preserved on edit #21064

@deder-byte

Description

@deder-byte

NetBox Edition

NetBox Community

NetBox Version

v4.4.9

Python Version

3.12

Steps to Reproduce

Create or edit a Custom Field Choice Set.

Add a choice containing a colon that is escaped with a backslash, for example:

foo\:bar:label

Save the custom field choice set.

Reopen the custom field choice set and edit the same choice again.

Observe that the backslash escape is no longer present (the value now appears as foo:bar:label).

Save the custom field choice set again.

Expected Behavior

The escaped colon (:) should be preserved when editing and re-saving the custom field choice.

The choice should remain a single literal value/label, not be reinterpreted.

Observed Behavior

The backslash escape is removed when the choice field is edited.

Upon saving, the colon is interpreted as a label/value separator, resulting in an unintended label/value assignment.

Metadata

Metadata

Assignees

Labels

netboxseverity: 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