Opened 19 years ago
Closed 19 years ago
#2388 closed defect (fixed)
[patch]login_required decorator in contrib.auth doesn't preserve doc string or dict of decorated function.
| Reported by: | Owned by: | Adrian Holovaty | |
|---|---|---|---|
| Component: | Contrib apps | Version: | dev |
| Severity: | minor | Keywords: | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Functions decorated with django.contrib.auth's login_required decorator don't inherit the name, doc, or dict attributes of the functions they decorate.
The login_required decorator returns an inner function, so I would expect that it would simply set the attributes accordingly. In fact, a patch is applied which does exactly that.
In this way examining methods in the shell makes it more transparent that a decorator is applied and allows developer documentation strings to percolate past the decoration.
Attachments (1)
Change History (3)
by , 19 years ago
| Attachment: | decorators.py.diff added |
|---|
comment:1 by , 19 years ago
| Summary: | login_required decorator in contrib.auth doesn't preserve doc string or dict of decorated function. → [patch]login_required decorator in contrib.auth doesn't preserve doc string or dict of decorated function. |
|---|
comment:2 by , 19 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Patch to decorators.py.