From f1ca71ce217a0477bc1f54dfd551b5da23386e41 Mon Sep 17 00:00:00 2001 From: s-m-b Date: Thu, 6 Apr 2017 16:38:28 +0400 Subject: [PATCH] Pass initkwargs stored on view to instance --- rest_framework/utils/breadcrumbs.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rest_framework/utils/breadcrumbs.py b/rest_framework/utils/breadcrumbs.py index e6e7e3cc3..22f0d8a3b 100644 --- a/rest_framework/utils/breadcrumbs.py +++ b/rest_framework/utils/breadcrumbs.py @@ -24,11 +24,12 @@ def get_breadcrumbs(url, request=None): # Check if this is a REST framework view, # and if so add it to the breadcrumbs cls = getattr(view, 'cls', None) + initkwargs = getattr(view, 'initkwargs', {}) if cls is not None and issubclass(cls, APIView): # Don't list the same view twice in a row. # Probably an optional trailing slash. if not seen or seen[-1] != view: - c = cls() + c = cls(**initkwargs) c.suffix = getattr(view, 'suffix', None) name = c.get_view_name() insert_url = preserve_builtin_query_params(prefix + url, request)