mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-06-16 11:33:19 +03:00
Merge pull request #941 from FreakyDug/master
Fixed a couple of small problems I found when using the action decorator.
This commit is contained in:
commit
8b0d4115c6
|
@ -108,7 +108,7 @@ For example:
|
|||
queryset = User.objects.all()
|
||||
serializer_class = UserSerializer
|
||||
|
||||
@action
|
||||
@action()
|
||||
def set_password(self, request, pk=None):
|
||||
user = self.get_object()
|
||||
serializer = PasswordSerializer(data=request.DATA)
|
||||
|
|
|
@ -136,6 +136,7 @@ class SimpleRouter(BaseRouter):
|
|||
attr = getattr(viewset, methodname)
|
||||
httpmethods = getattr(attr, 'bind_to_methods', None)
|
||||
if httpmethods:
|
||||
httpmethods = [method.lower() for method in httpmethods]
|
||||
dynamic_routes.append((httpmethods, methodname))
|
||||
|
||||
ret = []
|
||||
|
|
Loading…
Reference in New Issue
Block a user