Setting: Improve type checking
Update the type checking from using Django's six port to use direct list and tuple instance checking. Needed for Python 3. Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -10,7 +10,6 @@ import yaml
|
|||||||
|
|
||||||
from django.apps import apps
|
from django.apps import apps
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.utils import six
|
|
||||||
from django.utils.functional import Promise
|
from django.utils.functional import Promise
|
||||||
from django.utils.encoding import force_text, python_2_unicode_compatible
|
from django.utils.encoding import force_text, python_2_unicode_compatible
|
||||||
|
|
||||||
@@ -84,7 +83,7 @@ class Setting(object):
|
|||||||
"""
|
"""
|
||||||
Walk all the elements of a value and force promises to text
|
Walk all the elements of a value and force promises to text
|
||||||
"""
|
"""
|
||||||
if isinstance(value, (six.types.ListType, six.types.TupleType)):
|
if isinstance(value, (list, tuple)):
|
||||||
return [Setting.express_promises(item) for item in value]
|
return [Setting.express_promises(item) for item in value]
|
||||||
elif isinstance(value, Promise):
|
elif isinstance(value, Promise):
|
||||||
return force_text(value)
|
return force_text(value)
|
||||||
|
|||||||
Reference in New Issue
Block a user