We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The views decorators' order matters. Indeed,
@api_view(['GET']) @permission_classes([IsAuthenticated]) def my_view(request): pass
is different from:
@permission_classes([IsAuthenticated]) @api_view(['GET']) def my_view(request): pass
This is clearly stated in the documentation (https://www.django-rest-framework.org/api-guide/views/#api-policy-decorators). Nevertheless, I find it easy to miss and it may have security implication too.
Shouldn't the latter throw an exception, as it may have security implication? If not, is anyone aware of a linter to avoid such error?
If needed, I've created a repo to illustrate this: https://github.com/fdevillard/drf-decorator-ordering-demo
Thanks ! :)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The views decorators' order matters. Indeed,
is different from:
This is clearly stated in the documentation (https://www.django-rest-framework.org/api-guide/views/#api-policy-decorators). Nevertheless, I find it easy to miss and it may have security implication too.
Shouldn't the latter throw an exception, as it may have security implication? If not, is anyone aware of a linter to avoid such error?
If needed, I've created a repo to illustrate this: https://github.com/fdevillard/drf-decorator-ordering-demo
Thanks ! :)
The text was updated successfully, but these errors were encountered: