#30149: Empty value selected check in Admin Filter prevents subclassing
-------------------------------------+-------------------------------------
Reporter: Sardorbek Imomaliev | Owner: nobody
Type: Uncategorized | Status: new
Component: contrib.admin | Version: 2.1
Severity: Normal | Resolution:
Keywords: admin | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Sardorbek Imomaliev):
Yes this is exactly the issue because, `self.lookup_val_isnull` can be
either `'True'` or `'False'` as strings, and if they are stored as strings
they both will evaluate as `True` if you do
`bool(self.lookup_val_isnull)`. So we need to do string comparison, or
change how `self.lookup_val_isnull` is stored, which is not backwards
compatible. Would it be ok if I provide fix?
Replying to [comment:3 Carlton Gibson]:
> OK. Typing that post, and correcting my backticks, I see the issue with
`bool(self.lookup_val_isnull)` is that you want to compare against the
**string** `'False'`... (that part at least then makes sense).
> `
--
Ticket URL: <https://code.djangoproject.com/ticket/30149#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.7347018195cb9d3bd19fc941b0fcf90a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.