Code

Opened 9 years ago

Closed 9 years ago

Last modified 8 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@… 9 years ago.
Patch for glitch in filter registration decorator

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by django@…

Patch for glitch in filter registration decorator

comment:1 Changed 9 years ago by adrian

Hmmm, why do the default filters all work?

comment:2 Changed 9 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 9 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 9 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?

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.