#3482: MultipleChoiceField validation against a list with a single null element -------------------------------------+------------------------------------- Reporter: Jeff Bauer | Owner: nobody <jbauer@…> | Type: Bug | Status: closed Component: Forms | Version: dev Severity: Normal | Resolution: wontfix Keywords: MultipleChoiceField | Triage Stage: | Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+------------------------------------- Changes (by Carlton Gibson):
* status: new => closed * resolution: => wontfix Comment: So, it's hard to say about the dark-history here, as bootstrapping a very old environment is somewhat fiddly these days but [https://github.com/django/django/blob/d0ea01af2814e276c4a090e599d5fd11c6ce4bf8/django/forms/fields.py#L884-L890 the logic here] is virtually unchanged from the [https://github.com/django/django/commit/6645d1fe48868814e4c73056b68be5c3861ed2d0 #diff- 19fae1b4e3786d4af8cdf8db08d18d687caeae43859b35c769deb96d3aacf05cR256-R260 earliest days of the MultipleChoiceField implementation]. It's certainly unchanged as far back as Django 1.8. Without a serious case being made, the backwards compatibility concerns preclude changing this now. However, for me, this is expected behaviour: `''` is **not** a valid choice. If I want filtering of empty values then I'm expecting to use a widget to filter this in `value_from_datadict`, or else a field subclass, if I want the behaviour there. The default implementation is doing the right thing here rejecting the incorrect value. -- Ticket URL: <https://code.djangoproject.com/ticket/3482#comment:7> 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 django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/087.ab570d04b62d8999926178c390b9a387%40djangoproject.com.