From dd036468299ea4c3ba1448b811fa9fd8cd3f58bb Mon Sep 17 00:00:00 2001 From: Sergey Klyuykov Date: Fri, 28 Jul 2023 15:10:01 -0700 Subject: [PATCH] Fix: Provide support for disabling actions in child viewsets. --- rest_framework/routers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/routers.py b/rest_framework/routers.py index fa5d16922..3011026fa 100644 --- a/rest_framework/routers.py +++ b/rest_framework/routers.py @@ -231,7 +231,7 @@ class SimpleRouter(BaseRouter): """ bound_methods = {} for method, action in method_map.items(): - if hasattr(viewset, action): + if getattr(viewset, action, None) is not None: bound_methods[method] = action return bound_methods