Opened 10 years ago
Closed 10 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 , 10 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:2 by , 10 years ago
comment:3 by , 10 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 , 10 years ago
| Resolution: | → wontfix |
|---|---|
| Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
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.