Opened 14 years ago
Closed 14 years ago
#16178 closed Cleanup/optimization (fixed)
Cleanup request classes' __repr__()
| Reported by: | Julien Phalip | Owned by: | nobody |
|---|---|---|---|
| Component: | HTTP handling | Version: | 1.3 |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Ready for checkin | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
As discussed in https://code.djangoproject.com/ticket/14614#comment:16, there are a few small inconsistencies and some duplicated code in HttpRequest's, ModPythonRequest's, and WSGIRequest's __repr__() methods, and since [16339] also in ExceptionReporterFilter.get_request_repr (). The attached patch consolidates all that code into a single function. Note that I had to initialise the _post_parse_error attribute in the HttpRequest constructor, which should make sense since that attribute is used in some of HttpRequest's methods anyway.
Attachments (1)
Change History (5)
by , 14 years ago
| Attachment: | 16178.request_repr.diff added |
|---|
comment:1 by , 14 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:2 by , 14 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
Any patch that removes ~40 lines of code from the core and adds the same amount of them to the test is RFC in my book :)
Patch looks good, it applies without problem. The tests pass.