Opened 3 years ago
Closed 3 years ago
#32842 closed Cleanup/optimization (fixed)
Refactor out a _check_token() method of CsrfViewMiddleware
Reported by: | Chris Jerdonek | Owned by: | Chris Jerdonek |
---|---|---|---|
Component: | CSRF | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
This ticket is to refactor the following 40 lines of CsrfViewMiddleware.process_view()
:
https://github.com/django/django/blob/854e9b066850b9b4eb1171966e996322b2c16d27/django/middleware/csrf.py#L377-L417
into a new CsrfViewMiddleware._check_token()
method, similar to how CsrfViewMiddleware._check_referer() was done in #32596. This would group together all of the token-related logic and further reduce the size of `process_view(), which is currently 90 lines long.
Change History (4)
comment:1 by , 3 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:3 by , 3 years ago
Has patch: | set |
---|
Note:
See TracTickets
for help on using tickets.
OK, continuing the effort to make this more generally comprehensible +1. Thanks.