Device List Role filter duplicates first item #2413

Closed
opened 2025-12-29 17:25:52 +01:00 by adam · 4 comments
Owner

Originally created by @stuntguy3000 on GitHub (Feb 28, 2019).

Originally assigned to: @lampwins on GitHub.

Environment

  • Python version: 2.7.5
  • NetBox version: v2.5.7

Steps to Reproduce

  1. Go to Devices overview page
  2. Try to filter by Role

Expected Behavior

The device roles should appear only once.

Observed Behavior

image

Originally created by @stuntguy3000 on GitHub (Feb 28, 2019). Originally assigned to: @lampwins on GitHub. ### Environment * Python version: 2.7.5 * NetBox version: v2.5.7 ### Steps to Reproduce 1. Go to *Devices* overview page 2. Try to filter by _Role_ ### Expected Behavior The device roles should appear only once. ### Observed Behavior ![image](https://user-images.githubusercontent.com/1522389/53541746-26341e00-3b6b-11e9-87bd-6a7568afbca4.png)
adam added the type: bugstatus: accepted labels 2025-12-29 17:25:52 +01:00
adam closed this issue 2025-12-29 17:25:52 +01:00
Author
Owner

@zelfix commented on GitHub (Feb 28, 2019):

There is the same bug
image

@zelfix commented on GitHub (Feb 28, 2019): There is the same bug ![image](https://user-images.githubusercontent.com/10135380/53561065-e2d3b280-3b5e-11e9-844f-aff6e0df92d3.png)
Author
Owner

@jeremystretch commented on GitHub (Mar 6, 2019):

@lampwins think you'd be able to take a look at this?

@jeremystretch commented on GitHub (Mar 6, 2019): @lampwins think you'd be able to take a look at this?
Author
Owner

@lampwins commented on GitHub (Mar 6, 2019):

Yes, I will take care of this.

@lampwins commented on GitHub (Mar 6, 2019): Yes, I will take care of this.
Author
Owner

@lampwins commented on GitHub (Mar 17, 2019):

For reference, this occurs when null_option is True on the widget but the field does not specify a null_label.

    role = FilterChoiceField(
        queryset=DeviceRole.objects.all(),
        to_field_name='slug',
        widget=APISelectMultiple(
            api_url="/api/dcim/device-roles/",
            value_field="slug",
            null_option=True
        )
    )
@lampwins commented on GitHub (Mar 17, 2019): For reference, this occurs when `null_option` is True on the widget but the field does not specify a `null_label`. ``` role = FilterChoiceField( queryset=DeviceRole.objects.all(), to_field_name='slug', widget=APISelectMultiple( api_url="/api/dcim/device-roles/", value_field="slug", null_option=True ) ) ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2413