Opened 9 years ago

Closed 8 years ago

#25675 closed Cleanup/optimization (wontfix)

divisibleby template filter optimization

Reported by: Hasan Ramezani Owned by: Hasan Ramezani
Component: Template system Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

django template system return ValueError if in divisibleby template filter, ‍‍‍value or argument can not convert to Int.

it is better to return False in this case

Change History (4)

comment:1 by Hasan Ramezani, 9 years ago

Owner: changed from nobody to Hasan Ramezani
Status: newassigned

comment:2 by Anton Baklanov, 9 years ago

I'm not sure that returning False is the best behaviour here.

I would like an exception to be raised for "John Doe"|divisibleby:"bananas" since something is clearly going wrong with my math in this case.

comment:3 by Preston Timmons, 8 years ago

Django template tags and filters have a history of implicit behavior and silencing errors that leads to hard to debug problems. I don't think we should encourage that pattern further. I'm inclined to mark this as wontfix.

comment:4 by Claude Paroz, 8 years ago

Resolution: wontfix
Status: assignedclosed
Note: See TracTickets for help on using tickets.
Back to Top