Skip to content

Commit 78569a9

Browse files
author
Eric Honkanen
committed
Fixed py3 compat issue
1 parent b344a2d commit 78569a9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎rest_framework_ember/utils.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import six
12
import inflection
23

34
from django.conf import settings
@@ -26,7 +27,7 @@ def get_resource_name(view):
2627
except AttributeError:
2728
resource_name = view.__class__.__name__
2829

29-
if isinstance(resource_name, basestring):
30+
if isinstance(resource_name, six.string_types):
3031
return inflection.camelize(resource_name, False)
3132

3233
return resource_name
@@ -39,8 +40,8 @@ def format_keys(obj, format_type=None):
3940
4041
:format_type: Either 'camelize' or 'underscore'
4142
"""
42-
if getattr(settings, 'REST_EMBER_FORMAT_KEYS', False)\
43-
and format_type in ('camelize', 'underscore'):
43+
if (getattr(settings, 'REST_EMBER_FORMAT_KEYS', False)
44+
and format_type in ('camelize', 'underscore')):
4445

4546
if isinstance(obj, dict):
4647
formatted = {}

0 commit comments

Comments
 (0)