Fix unicode type judgment

This patch changes judgment for "unicode" type to "six.text_type".

Change-Id: I55869266338e61c10118d327ca51c463c0fa6ad4
This commit is contained in:
Shu Muto 2018-04-26 17:48:37 +09:00
parent 530ba016ad
commit 18f4af1a23
1 changed files with 2 additions and 1 deletions

View File

@ -15,6 +15,7 @@
from __future__ import absolute_import
import logging
import six
from django.conf import settings
@ -50,7 +51,7 @@ def _cleanup_params(attrs, create, **params):
raise exceptions.BadRequest(
"Key must be in %s" % ",".join(attrs))
if key == "labels":
if isinstance(value, str) or isinstance(value, unicode):
if isinstance(value, str) or isinstance(value, six.text_type):
labels = {}
vals = value.split(",")
for v in vals: