Opened 14 years ago

Closed 13 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 14 years ago.
15840.unittests.run.log (3.8 KB ) - added by portante 14 years ago.
15840.patch.2.diff (2.4 KB ) - added by dmclain 14 years ago.
Sackcloth and ashes tour
15840.patch.3.diff (1.5 KB ) - added by Zbigniew Siciarz 13 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)

by portante, 14 years ago

Attachment: 15840.patch.diff added

by portante, 14 years ago

Attachment: 15840.unittests.run.log added

comment:1 by Johannes Dollinger, 14 years ago

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

comment:2 by patchhammer, 14 years ago

Patch needs improvement: set

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

by dmclain, 14 years ago

Attachment: 15840.patch.2.diff added

Sackcloth and ashes tour

comment:3 by dmclain, 14 years ago

Patch needs improvement: unset

comment:4 by Jonas Obrist, 13 years ago

Patch needs improvement: set
UI/UX: unset

Patch doesn't apply clean on trunk.

comment:5 by Zbigniew Siciarz, 13 years ago

Owner: changed from nobody to Zbigniew Siciarz

by Zbigniew Siciarz, 13 years ago

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 by Łukasz Rekucki, 13 years ago

Triage Stage: AcceptedReady for checkin

Verified.

comment:7 by Jannis Leidel, 13 years ago

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