django-advanced-filters icon indicating copy to clipboard operation
django-advanced-filters copied to clipboard

Fix the issue 'AdvancedFilterQueryForm' object has no attribute 'clea…

Open hzung opened this issue 4 years ago • 2 comments

…ned_data'

hzung avatar Nov 02 '21 11:11 hzung

Thanks for opening a PR @hzung (and for following up on it @MAbdurrehman1); could either of you provide some more details on where you experience this issue? P.s: a reproducible step-by-step (or even better: a failing test) would be great!

asfaltboy avatar Dec 19 '21 09:12 asfaltboy

Thanks for opening a PR @hzung (and for following up on it @MAbdurrehman1); could either of you provide some more details on where you experience this issue? P.s: a reproducible step-by-step (or even better: a failing test) would be great!

@asfaltboy if you want to reproduce it, checkout my open source Django project Django Coleman: https://github.com/mrsarm/django-coleman . I used to have a pinned version of django-advanced-filters working OK, but when I did the upgrade to Django 3.2 the project start to fail with this error that happens not when launching the app but when trying to apply a filter:

django-advance-filter-error

Installing django-advanced-filters with the version of this PR worked, this is the commit where I made the upgrade of Django with django-advanced-filters installed from this PR, if you try to change in the requirements.txt with the latest version of django-advanced-filters you will see the error.

mrsarm avatar Feb 08 '22 19:02 mrsarm

Thanks for the additional information @mrsarm . Just looking at the screenshot, this looks like this is caused by an empty option being allowed to pass validation. Is it true that this used to work well in older versions? What used to happen then, would it show a validation error?

asfaltboy avatar Sep 25 '22 09:09 asfaltboy

Thanks for the additional information @mrsarm . Just looking at the screenshot, this looks like this is caused by an empty option being allowed to pass validation. Is it true that this used to work well in older versions? What used to happen then, would it show a validation error?

What do you mean with empty options? you mean I left empty the options in the field for the filtering? I'll test during next week, but still the UI shouldn't allow me to save an invalid set of configurations and then fail if that is the case, maybe as you said that is the cause, but in older versions some JS or server side validation prevented the configuration to be saved, because the same action ended up in a different result with older versions, but I can't recall at this point.

mrsarm avatar Sep 25 '22 18:09 mrsarm

FWIW, I was not able to reproduce the issue described in 2.0. @mrsarm if you still have issues with the latest version, please open a new ticket with all the details + step-by-step example on how one could reproduce this.

asfaltboy avatar Oct 08 '22 18:10 asfaltboy