Fixed #30600 -- Clarified that ValueError raised by converter.to_python() means no match.

This commit is contained in:
sp1rs 2019-07-03 23:30:18 +05:30 committed by Mariusz Felisiak
parent d37ea5f09b
commit f197c3dd91
1 changed files with 3 additions and 1 deletions

View File

@ -146,7 +146,9 @@ A converter is a class that includes the following:
* A ``to_python(self, value)`` method, which handles converting the matched
string into the type that should be passed to the view function. It should
raise ``ValueError`` if it can't convert the given value.
raise ``ValueError`` if it can't convert the given value. A ``ValueError`` is
interpreted as no match and as a consequence a 404 response is sent to the
user.
* A ``to_url(self, value)`` method, which handles converting the Python type
into a string to be used in the URL.