modlinltd/django-advanced-filters

Negate not been respected

Opened this issue · 1 comments

Describe the bug
I have a "follower" object, with many to many language field have "he" and "ar".
I choose "he" and not "ar":
image

But I did find Arabic (ar) in the results:
image

and checked that this user have "ar":
image

DEBUG LOG:
DEBUG {'children': [['language__code_name__iexact', 'he'], <Q: (NOT (AND: ['language__code_name__iexact', 'ar']))>, ['gender__iexact', 'female']], 'connector': 'AND', 'negated': False}

So why he shows up in results ?

Details (please complete the following information):

  • OS: [e.g. iOS]
  • Python version [e.g 3.7] 3.7.4
  • Django version [e. 2.1]
  • django-advanced-filters version [e.g 1.1]
  • Browser [e.g. chrome, safari] chrome

image

So once the NEGATE condition is first it will work.
Once I do like this:
image

It will not work.