From 23c2060f01c88f8db207e7b661780f9fb9bc4edb Mon Sep 17 00:00:00 2001 From: Arpit Goyal Date: Sat, 26 Nov 2016 20:32:30 +0530 Subject: [PATCH] Support for permission classes specified using rest_condition --- rest_framework_docs/api_endpoint.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rest_framework_docs/api_endpoint.py b/rest_framework_docs/api_endpoint.py index 89a33f8..4049339 100644 --- a/rest_framework_docs/api_endpoint.py +++ b/rest_framework_docs/api_endpoint.py @@ -71,7 +71,10 @@ def __get_docstring__(self): def __get_permissions_class__(self): for perm_class in self.pattern.callback.cls.permission_classes: - return perm_class.__name__ + try: + return perm_class.__name__ + except: + return perm_class.__class__.__name__ def __get_serializer__(self): try: