CSRF protection in django.contrib.flatpages.views.flatpage causes unwanted behavior
|Reported by:||patrys||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
If you only decorate selected views with csrf_protect, any non-protected POST that ends up resulting in a 404 response returns 403 Forbidden instead.
This is both unwanted and potentially puzzling to developers. Either the flatpage view should not be decorated (it seems incapable of altering the application's state) or the above should be documented both in the CSRF section and in the flatpages section.
Change History (3)
comment:1 Changed 5 years ago by russellm
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted