We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f379bf0 commit 91db70dCopy full SHA for 91db70d
rest_framework_json_api/utils.py
@@ -35,8 +35,9 @@ def get_resource_name(context):
35
if code.startswith('4') or code.startswith('5'):
36
return 'errors'
37
38
- resource_name = getattr(view, 'resource_name')
39
- if not resource_name:
+ try:
+ resource_name = getattr(view, 'resource_name')
40
+ except AttributeError:
41
try:
42
# Check the meta class
43
resource_name = (
@@ -92,7 +93,7 @@ def format_resource_name(obj, name):
92
93
"""
94
Pluralize the resource name if more than one object in results.
95
- if (getattr(settings, 'REST_EMBER_PLURALIZE_KEYS')
96
+ if (getattr(settings, 'REST_EMBER_PLURALIZE_KEYS', None)
97
and isinstance(obj, list)):
98
99
return inflection.pluralize(name)
0 commit comments