Opened 19 years ago

Closed 19 years ago

Last modified 18 years ago

#962 closed defect (fixed)

[patch] Filter registration decorator is missing a return statement

Reported by: django@… 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)

register_filter_fix_r1496.diff (567 bytes ) - added by django@… 19 years ago.
Patch for glitch in filter registration decorator

Download all attachments as: .zip

Change History (5)

by django@…, 19 years ago

Patch for glitch in filter registration decorator

comment:1 by Adrian Holovaty, 19 years ago

Hmmm, why do the default filters all work?

comment:2 by Adrian Holovaty, 19 years ago

Resolution: fixed
Status: newclosed

(In [1497]) Fixed #962 -- Gave filter-registration decorator a return statement. Thanks, Kieran

comment:3 by rjwittams., 19 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 django@…, 19 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.
Back to Top