This commit is contained in:
Omer Katz 2017-04-15 22:51:27 +00:00 committed by GitHub
commit 3be6e3e4f6

View File

@ -30,6 +30,10 @@ def get_view_name(view_cls, suffix=None):
This function is the default for the `VIEW_NAME_FUNCTION` setting. This function is the default for the `VIEW_NAME_FUNCTION` setting.
""" """
try:
view = view_cls()
name = view.get_view_name()
except:
name = view_cls.__name__ name = view_cls.__name__
name = formatting.remove_trailing_string(name, 'View') name = formatting.remove_trailing_string(name, 'View')
name = formatting.remove_trailing_string(name, 'ViewSet') name = formatting.remove_trailing_string(name, 'ViewSet')