Skip to content

Commit 7051841

Browse files
author
Eric Honkanen
committed
Update get_resource_name
1 parent f5ea1de commit 7051841

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

rest_framework_json_api/utils.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,8 @@ def get_resource_name(context):
3535
if code.startswith('4') or code.startswith('5'):
3636
return 'errors'
3737

38-
try:
39-
# Check the view
40-
resource_name = getattr(view, 'resource_name')
41-
except AttributeError:
38+
resource_name = getattr(view, 'resource_name')
39+
if not resource_name:
4240
try:
4341
# Check the meta class
4442
resource_name = (

0 commit comments

Comments
 (0)