Opened 4 years ago

Closed 4 years ago

#15840 closed Cleanup/optimization (fixed)

[patch] wrap the inner function of the condition decorator

Reported by: portante Owned by: zsiciarz
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 4 years ago.
15840.unittests.run.log (3.8 KB) - added by portante 4 years ago.
15840.patch.2.diff (2.4 KB) - added by dmclain 4 years ago.
Sackcloth and ashes tour
15840.patch.3.diff (1.5 KB) - added by zsiciarz 4 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 4 years ago by portante

Changed 4 years ago by portante

comment:1 Changed 4 years ago by emulbreh

  • Component changed from Uncategorized to Core (Other)
  • Easy pickings set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 4 years ago by patchhammer

  • Patch needs improvement set

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

Changed 4 years ago by dmclain

Sackcloth and ashes tour

comment:3 Changed 4 years ago by dmclain

  • Patch needs improvement unset

comment:4 Changed 4 years ago by ojii

  • Patch needs improvement set
  • UI/UX unset

Patch doesn't apply clean on trunk.

comment:5 Changed 4 years ago by zsiciarz

  • Owner changed from nobody to zsiciarz

Changed 4 years ago by zsiciarz

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 4 years ago by lrekucki

  • Triage Stage changed from Accepted to Ready for checkin

Verified.

comment:7 Changed 4 years ago by jezdez

  • Resolution set to fixed
  • Status changed from new to closed

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