Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#962 closed defect (fixed)

[patch] Filter registration decorator is missing a return statement

Reported by: django@… Owned by: adrian
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: UI/UX:

Description

See attached patch against r1496.

Attachments (1)

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

Download all attachments as: .zip

Change History (5)

Changed 10 years ago by django@…

Patch for glitch in filter registration decorator

comment:1 Changed 10 years ago by adrian

Hmmm, why do the default filters all work?

comment:2 Changed 10 years ago by adrian

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

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

comment:3 Changed 10 years ago by rjwittams.

The return is pointless - the exact bit of code you've got to is a case that couldn't be a decorator.

comment:4 Changed 10 years ago by django@…

@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