mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-06-23 06:53:16 +03:00
parent
46f5c62530
commit
e88e3c6ae1
|
@ -452,7 +452,9 @@ class CharField(WritableField):
|
||||||
self.validators.append(validators.MaxLengthValidator(max_length))
|
self.validators.append(validators.MaxLengthValidator(max_length))
|
||||||
|
|
||||||
def from_native(self, value):
|
def from_native(self, value):
|
||||||
if isinstance(value, six.string_types) or value is None:
|
if value is None:
|
||||||
|
return ''
|
||||||
|
if isinstance(value, six.string_types):
|
||||||
return value
|
return value
|
||||||
return smart_text(value)
|
return smart_text(value)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user