Opened 6 years ago

Closed 5 years ago

#15840 closed Cleanup/optimization (fixed)

[patch] wrap the inner function of the condition decorator

Reported by: portante Owned by: Zbigniew Siciarz
Component: Core (Other) Version:
Severity: Normal Keywords:
Cc: portante Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: yes UI/UX: no

Description

Like all the other inner functions in the django/views/decorators/http.py module, wrap the inner function so that it exposes it's wrapped function's attributes.

Ran the unit tests successfully on my Mac Book Pro (10.6.7, 2 cores, 4 GB), see attached unit test run output.

Attachments (4)

15840.patch.diff (1.8 KB) - added by portante 6 years ago.
15840.unittests.run.log (3.8 KB) - added by portante 6 years ago.
15840.patch.2.diff (2.4 KB) - added by dmclain 6 years ago.
Sackcloth and ashes tour
15840.patch.3.diff (1.5 KB) - added by Zbigniew Siciarz 5 years ago.
Improved the patch so it applies cleanly to current trunk. Only the condition decorator needs testing, as the other two are implemented in terms of it.

Download all attachments as: .zip

Change History (11)

Changed 6 years ago by portante

Attachment: 15840.patch.diff added

Changed 6 years ago by portante

Attachment: 15840.unittests.run.log added

comment:1 Changed 6 years ago by Johannes Dollinger

Component: UncategorizedCore (Other)
Easy pickings: set
Triage Stage: UnreviewedAccepted

comment:2 Changed 6 years ago by patchhammer

Patch needs improvement: set

15840.patch.diff fails to apply cleanly on to trunk

Changed 6 years ago by dmclain

Attachment: 15840.patch.2.diff added

Sackcloth and ashes tour

comment:3 Changed 6 years ago by dmclain

Patch needs improvement: unset

comment:4 Changed 5 years ago by Jonas Obrist

Patch needs improvement: set
UI/UX: unset

Patch doesn't apply clean on trunk.

comment:5 Changed 5 years ago by Zbigniew Siciarz

Owner: changed from nobody to Zbigniew Siciarz

Changed 5 years ago by Zbigniew Siciarz

Attachment: 15840.patch.3.diff added

Improved the patch so it applies cleanly to current trunk. Only the condition decorator needs testing, as the other two are implemented in terms of it.

comment:6 Changed 5 years ago by Łukasz Rekucki

Triage Stage: AcceptedReady for checkin

Verified.

comment:7 Changed 5 years ago by Jannis Leidel

Resolution: fixed
Status: newclosed

In [17470]:

Fixed #15840 -- Wrapped inner function of the condition decorator with functools.wraps to follow best practices. Thanks, zsiciarz.

Note: See TracTickets for help on using tickets.
Back to Top