forked from GithubBackups/healthchecks
Use six.string_types. This hopefully fixes python 2 test failures.
This commit is contained in:
parent
5d2edfa4a0
commit
5725a3a30a
@ -4,6 +4,7 @@ from functools import wraps
|
|||||||
|
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.http import HttpResponseBadRequest, JsonResponse
|
from django.http import HttpResponseBadRequest, JsonResponse
|
||||||
|
from six import string_types
|
||||||
|
|
||||||
|
|
||||||
def uuid_or_400(f):
|
def uuid_or_400(f):
|
||||||
@ -62,7 +63,7 @@ def validate_json(schema):
|
|||||||
|
|
||||||
value = request.json[key]
|
value = request.json[key]
|
||||||
if spec["type"] == "string":
|
if spec["type"] == "string":
|
||||||
if not isinstance(value, str):
|
if not isinstance(value, string_types):
|
||||||
return make_error("%s is not a string" % key)
|
return make_error("%s is not a string" % key)
|
||||||
elif spec["type"] == "number":
|
elif spec["type"] == "number":
|
||||||
if not isinstance(value, int):
|
if not isinstance(value, int):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user