Skip to content

Bulk rename improperly strips "find" and "replace" fields #13791

@pv2b

Description

@pv2b

NetBox version

v3.6.1

Python version

3.11

Steps to Reproduce

  1. On an existing device, create an interface labeled something like "One Two".
  2. Go to the interface tab of that device, check the checkbox next to it and hit "rename".
  3. In the find field, enter "One " (note the trailing space!). In the replacement field enter "One-".
  4. Click the preview button.

Expected Behavior

NetBox should offer to rename the device to "One-Two".

Observed Behavior

Netbox offers to rename the device to "One- Two" (note the space).

My guess (I've not looked at the code) is that this happens because django autostrips whitespace from input fields by default, and this needs to be disabled.

Also, the same bug exists on the "replace" field, and is completely analagous to the replace field.

Workaround: For the "find" field, use regex mode and \s to match trailing whitespace. For the "replace" field, I don't know of a general workaround.

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

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions