From 5725a3a30a0066105a5777efae383094d67138c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Tue, 16 Feb 2016 23:50:41 +0200 Subject: [PATCH] Use six.string_types. This hopefully fixes python 2 test failures. --- hc/api/decorators.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hc/api/decorators.py b/hc/api/decorators.py index 8deef9fb..c025b51d 100644 --- a/hc/api/decorators.py +++ b/hc/api/decorators.py @@ -4,6 +4,7 @@ from functools import wraps from django.contrib.auth.models import User from django.http import HttpResponseBadRequest, JsonResponse +from six import string_types def uuid_or_400(f): @@ -62,7 +63,7 @@ def validate_json(schema): value = request.json[key] if spec["type"] == "string": - if not isinstance(value, str): + if not isinstance(value, string_types): return make_error("%s is not a string" % key) elif spec["type"] == "number": if not isinstance(value, int):