mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-03 20:10:10 +03:00
ensure smart_text will be called
This commit is contained in:
parent
8eadac39ad
commit
5e0b96b035
|
@ -474,10 +474,7 @@ 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):
|
if value in validators.EMPTY_VALUES:
|
||||||
return value
|
|
||||||
|
|
||||||
if value is None:
|
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
return smart_text(value)
|
return smart_text(value)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user