Browse Source

Use six.string_types. This hopefully fixes python 2 test failures.

pull/46/head
Pēteris Caune 9 years ago
parent
commit
5725a3a30a
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      hc/api/decorators.py

+ 2
- 1
hc/api/decorators.py View File

@ -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):


Loading…
Cancel
Save