-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Labels
severity: lowDoes not significantly disrupt application functionality, or a workaround is availableDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application
Milestone
Description
Deployment Type
Self-hosted
NetBox Version
v4.2.6
Python Version
3.10
Steps to Reproduce
- Open the form to create a custom field
- Select "object" for the type of field
- Enter something in the "related object filter field"
Expected Behavior
The form field should use a monospace text to preserve formatting.
Observed Behavior
The form field uses regular text. This is due to a bug in the field's init method, which applies the font-monospace CSS class only if the default help_text is used:
netbox/netbox/utilities/forms/fields/fields.py
Lines 98 to 103 in e1e5142
| def __init__(self, *args, **kwargs): | |
| super().__init__(*args, **kwargs) | |
| if not self.help_text: | |
| self.help_text = _('Enter context data in <a href="https://json.org/">JSON</a> format.') | |
| self.widget.attrs['placeholder'] = '' | |
| self.widget.attrs['class'] = 'font-monospace' |
Metadata
Metadata
Assignees
Labels
severity: lowDoes not significantly disrupt application functionality, or a workaround is availableDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application