1
0
mirror of https://github.com/django/django.git synced 2025-04-22 00:04:43 +00:00

[5.1.x] Fixed #35880 -- Removed invalid example in form Field.required docs due to CharField.strip.

CharField.strip was introduced in 11cac1bd8ef7546ca32d9969d4348bf412dc6664, and is True by
default, meaning the previous example of " " raised a ValidationError.

Backport of 72de38239fdc97751e1e4ed245c7073c31bbd28a from main.
This commit is contained in:
antoliny0919 2024-11-05 07:59:14 +09:00 committed by Sarah Boyce
parent a0d8fad23e
commit cae0c7f48a

View File

@ -65,8 +65,6 @@ an empty value -- either ``None`` or the empty string (``""``) -- then
Traceback (most recent call last):
...
ValidationError: ['This field is required.']
>>> f.clean(" ")
' '
>>> f.clean(0)
'0'
>>> f.clean(True)