#962 closed defect (fixed)
[patch] Filter registration decorator is missing a return statement
| Reported by: | Owned by: | Adrian Holovaty | |
|---|---|---|---|
| Component: | Core (Other) | Version: | |
| Severity: | normal | 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
See attached patch against r1496.
Attachments (1)
Change History (5)
by , 20 years ago
| Attachment: | register_filter_fix_r1496.diff added |
|---|
comment:2 by , 20 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:3 by , 20 years ago
The return is pointless - the exact bit of code you've got to is a case that couldn't be a decorator.
comment:4 by , 20 years ago
@register.filter('foo')
def bar(value):
print value
This code will add the filter 'foo' to the filters library but 'bar' in the defining module will be None because the decorator gave no return value.
Hey, where'd my function go?
Note:
See TracTickets
for help on using tickets.
Patch for glitch in filter registration decorator