-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not allow to pass an empty actions to viewset.as_view() #2175
Conversation
Merge upstream
Merge upstream
Also add unittest for viewset.as_view() |
|
||
class BasicViewSet(GenericViewSet): | ||
def list(self, request, *args, **kwargs): | ||
return Response({'METHOD': 'LIST'}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
METHOD is a confusing string to use here, as it could mean the request method. ACTION would be more descriptive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK.
Not allow to pass an empty actions to viewset.as_view()
Thanks! |
Not sure, but I was following the documentation about testing and got this exception
So, should the documentation be updated to add this actions argument? http://www.django-rest-framework.org/api-guide/testing/#forcing-authentication |
AccountDetail isn't a viewset so it doesn't have any use of the actions |
Ah yeah, of course, sometimes all the different kind of views are confusing ;) |
Validate actions value when invoke as_view(), raise a TypeError if no actions was passed in.
Refs #2171