Skip to content
This repository was archived by the owner on Oct 8, 2024. It is now read-only.

Commit 8273f48

Browse files
committed
getattr for improved readability
1 parent de2bece commit 8273f48

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

rest_framework_json_api/schemas/openapi.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,7 @@ def get_schema(self, request=None, public=False):
308308
elif hasattr(view, 'action') and view.action == 'retrieve_related':
309309
expanded_endpoints += self._expand_related(path, method, view, view_endpoints)
310310
else:
311-
expanded_endpoints.append((path, method, view,
312-
view.action if hasattr(view, 'action') else None))
311+
expanded_endpoints.append((path, method, view, getattr(view, 'action', None)))
313312

314313
for path, method, view, action in expanded_endpoints:
315314
if not self.has_view_permissions(path, method, view):

0 commit comments

Comments
 (0)