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

Filtering on null values for nullable CharFields is broken #2895

Closed
jeremystretch opened this issue Feb 14, 2019 · 0 comments
Closed

Filtering on null values for nullable CharFields is broken #2895

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

Comments

@jeremystretch
Copy link
Member

Environment

  • Python version: 3.5.2
  • NetBox version: 2.5.6

Steps to Reproduce

  1. Attempt to filter the racks list by null facility_id value:

http://netbox/dcim/racks/?facility_id=null

Expected Behavior

Only racks with a null facility_id should be returned.

Observed Behavior

The filter has no effect. There are two issues at play here.

First, NullableCharFieldFilter is looking for a query parameter of NULL rather than null as specified in settings.py. Second, if NULL is passed, an exception occurs due to the filter using obsolete syntax: self.name should be self.field_name.

@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 14, 2019
@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

1 participant