mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-02 20:54:42 +03:00
Added support for 'true'/'false' as valid boolean data
This commit is contained in:
parent
3e3ede71d2
commit
3867d9deb1
|
@ -693,9 +693,9 @@ class BooleanField(WritableField):
|
|||
default = False
|
||||
|
||||
def from_native(self, value):
|
||||
if value in ('t', 'True', '1'):
|
||||
if value in ('true', 't', 'True', '1'):
|
||||
return True
|
||||
if value in ('f', 'False', '0'):
|
||||
if value in ('false', 'f', 'False', '0'):
|
||||
return False
|
||||
return bool(value)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user