Skip to content

render_field does not show the custom "label" if set #10938

@PieterL75

Description

@PieterL75

NetBox version

v3.3.7

Python version

3.9

Steps to Reproduce

  1. create a form that uses the render_field and provides a custom label
  2. {% render_field form.provider_network_provider label="Provider" %}
  3. Open the page.

Expected Behavior

The custom label is shown in front of the widgets

Observed Behavior

The original fieldname is shown, and not the custom label.

def render_field(field, bulk_nullable=False, label=None):

allows to set a 'label' and returns it as a separate variable to the "form_helpers/render_field.html"
This form however always uses the 'field.label' and not the 'label' variable
There is a reference to the 'label' variable, but only for textarea's

Can we have the 'label' parameter always be displayed ?
My suggestion is to set the 'label' variable to the 'field.label' in 'def render_field' and then in the html always refer to label, rather than field.label

Metadata

Metadata

Assignees

Labels

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