Skip to content

Commit

Permalink
add NOT_EQUAL to operator mapping (fixes #1603)
Browse files Browse the repository at this point in the history
NOT_EQUAL was already special-cased as an exclusion operator by
Filter.check(), but the special case was never reached because of the
prior attempt to lookup the operator in the mapping dict, which caused a
KeyError.
  • Loading branch information
lunkwill42 committed Oct 26, 2017
1 parent 968291d commit 7645a18
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions python/nav/models/profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,7 @@ class Operator(models.Model):
# cased.
OPERATOR_MAPPING = {
EQUALS: '__exact',
NOT_EQUAL: '', # exclusion is special-cased by Filter.check()
GREATER: '__gt',
GREATER_EQ: '__gte',
LESS: '__lt',
Expand Down

0 comments on commit 7645a18

Please sign in to comment.