mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 17:47:04 +03:00
Fixes that namespaced views now also appear in the extra actions (#8598)
* Fixes that namespaced views now also appear in the extra actions Before this fix, namespaced views would not appear in the extra actions. With this fix they do. * Flake fix
This commit is contained in:
parent
c7acdd6006
commit
54d52c66fd
|
@ -198,6 +198,10 @@ class ViewSetMixin:
|
||||||
for action in actions:
|
for action in actions:
|
||||||
try:
|
try:
|
||||||
url_name = '%s-%s' % (self.basename, action.url_name)
|
url_name = '%s-%s' % (self.basename, action.url_name)
|
||||||
|
namespace = self.request.resolver_match.namespace
|
||||||
|
if namespace:
|
||||||
|
url_name = '%s:%s' % (namespace, url_name)
|
||||||
|
|
||||||
url = reverse(url_name, self.args, self.kwargs, request=self.request)
|
url = reverse(url_name, self.args, self.kwargs, request=self.request)
|
||||||
view = self.__class__(**action.kwargs)
|
view = self.__class__(**action.kwargs)
|
||||||
action_urls[view.get_view_name()] = url
|
action_urls[view.get_view_name()] = url
|
||||||
|
|
Loading…
Reference in New Issue
Block a user