Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Device List Role filter duplicates first item #2936

Closed
stuntguy3000 opened this issue Feb 28, 2019 · 4 comments
Closed

Device List Role filter duplicates first item #2936

stuntguy3000 opened this issue Feb 28, 2019 · 4 comments
Assignees
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@stuntguy3000
Copy link
Contributor

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

@zelfix
Copy link

zelfix commented Feb 28, 2019

There is the same bug
image

@jeremystretch jeremystretch added type: bug A confirmed report of unexpected behavior in the application status: accepted This issue has been accepted for implementation labels Feb 28, 2019
@jeremystretch
Copy link
Member

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

@lampwins lampwins self-assigned this Mar 6, 2019
@lampwins
Copy link
Contributor

lampwins commented Mar 6, 2019

Yes, I will take care of this.

@lampwins
Copy link
Contributor

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
        )
    )

@lock lock bot locked as resolved and limited conversation to collaborators Jan 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

4 participants