Merge "Replace basestring with six.string_types"

This commit is contained in:
Zuul 2017-10-16 03:09:59 +00:00 committed by Gerrit Code Review
commit d3d04fbe1d
1 changed files with 5 additions and 2 deletions

View File

@ -13,9 +13,12 @@
# under the License.
from decorator import decorator
import json
import flask
import itertools
import json
import six
from distil.models import Tenant
from distil import config
@ -81,7 +84,7 @@ def validate_tenant_id(tenant_id, session):
"""Tenant ID validation that check that the id you passed is valid,
and that a tenant with this ID exists.
- returns tenant query, or a tuple if validation failure."""
if isinstance(tenant_id, basestring):
if isinstance(tenant_id, six.string_types):
tenant_query = session.query(Tenant).\
filter(Tenant.id == tenant_id)
if tenant_query.count() == 0: