#22229: Invalid data can cause InlineFormSet.is_valid to throw ValueError -------------------------------------+------------------------------------- Reporter: anonymous | Owner: Jake | Rothenbuhler Type: Bug | Status: assigned Component: Forms | Version: 1.6 Severity: Normal | Resolution: Keywords: InlineFormSet | Triage Stage: Accepted Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by Jon Dufresne): > I'm not quite sure that we want to make is_valid() return False in this case. Generally speaking, user input (even malformed user input) should never result in a 500 response. A 500 response indicates an error server side. I think Django should catch this malformed user input and respond appropriately. The HTTP status codes used to represent user error or input error are 4XX. > the template would end up displaying an error message saying something like: "Invalid primary key for form that should have an existing instance." I agree that care will needed to present an error as useful as possible to the user, hopefully avoiding technical jargon. Given the nature of the input error, good phrasing may not be entirely possible. But I still think it shouldn't result in a 500 response. -- Ticket URL: <https://code.djangoproject.com/ticket/22229#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 django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/067.4645c8273127cfe22b3dbdbe62bf9b71%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.