Commit 8b0d4115 by Tom Christie

Merge pull request #941 from FreakyDug/master

Fixed a couple of small problems I found when using the action decorator.
parents 2d5f7f20 fa9f5fb8
...@@ -108,7 +108,7 @@ For example: ...@@ -108,7 +108,7 @@ For example:
queryset = User.objects.all() queryset = User.objects.all()
serializer_class = UserSerializer serializer_class = UserSerializer
@action @action()
def set_password(self, request, pk=None): def set_password(self, request, pk=None):
user = self.get_object() user = self.get_object()
serializer = PasswordSerializer(data=request.DATA) serializer = PasswordSerializer(data=request.DATA)
......
...@@ -136,6 +136,7 @@ class SimpleRouter(BaseRouter): ...@@ -136,6 +136,7 @@ class SimpleRouter(BaseRouter):
attr = getattr(viewset, methodname) attr = getattr(viewset, methodname)
httpmethods = getattr(attr, 'bind_to_methods', None) httpmethods = getattr(attr, 'bind_to_methods', None)
if httpmethods: if httpmethods:
httpmethods = [method.lower() for method in httpmethods]
dynamic_routes.append((httpmethods, methodname)) dynamic_routes.append((httpmethods, methodname))
ret = [] ret = []
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment