aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework
diff options
context:
space:
mode:
authorTom Christie2015-02-25 11:36:05 +0000
committerTom Christie2015-02-25 11:36:05 +0000
commit90f1c04c6b59cc0cadbb5e36251b130d96307943 (patch)
tree04b34df246b784eb04baf27b49e33498319df2cb /rest_framework
parentb69032f3a794bbc45974a6b362b186c494373ae1 (diff)
parent9cafdd1854ccd5215b7a188c5896fb498a59d725 (diff)
downloaddjango-rest-framework-90f1c04c6b59cc0cadbb5e36251b130d96307943.tar.bz2
Merge pull request #2595 from k4nar/fix_url_path
Fix url_path on dynamic routes for inherited viewsets. Fix #2583
Diffstat (limited to 'rest_framework')
-rw-r--r--rest_framework/routers.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/rest_framework/routers.py b/rest_framework/routers.py
index 6a4184e2..081654b8 100644
--- a/rest_framework/routers.py
+++ b/rest_framework/routers.py
@@ -171,9 +171,9 @@ class SimpleRouter(BaseRouter):
# Dynamic detail routes (@detail_route decorator)
for httpmethods, methodname in detail_routes:
method_kwargs = getattr(viewset, methodname).kwargs
- url_path = method_kwargs.pop("url_path", None) or methodname
initkwargs = route.initkwargs.copy()
initkwargs.update(method_kwargs)
+ url_path = initkwargs.pop("url_path", None) or methodname
ret.append(Route(
url=replace_methodname(route.url, url_path),
mapping=dict((httpmethod, methodname) for httpmethod in httpmethods),
@@ -184,9 +184,9 @@ class SimpleRouter(BaseRouter):
# Dynamic list routes (@list_route decorator)
for httpmethods, methodname in list_routes:
method_kwargs = getattr(viewset, methodname).kwargs
- url_path = method_kwargs.pop("url_path", None) or methodname
initkwargs = route.initkwargs.copy()
initkwargs.update(method_kwargs)
+ url_path = initkwargs.pop("url_path", None) or methodname
ret.append(Route(
url=replace_methodname(route.url, url_path),
mapping=dict((httpmethod, methodname) for httpmethod in httpmethods),