Opened 10 years ago

Closed 10 years ago

#23274 closed Bug (invalid)

Bad exception management: custom template tags

Reported by: micfan Owned by: nobody
Component: Template system Version: 1.5
Severity: Normal Keywords: custom template tags
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hey, I am writing a simple custom tags demo following (https://docs.djangoproject.com/en/dev/howto//#writing-custom-template-tags).

This line give me an exception: actual_date = self.date_to_be_formatted.resolve(context).

I think the mangement of exception is not good. See that https://github.com/django/django/blob/stable/1.7.x/django/template/base.py#L690, it add a judgement, however, this judgement did not control that https://github.com/django/django/blob/stable/1.7.x/django/template/base.py#L699 float(var) function's Exception, which tips me that:

TypeError at /
float() argument must be a string or a number
Request Method: GET
Request URL:    http://localhost:8000/
Django Version: 1.5
Exception Type: TypeError
Exception Value:        
float() argument must be a string or a number
Exception Location:     /usr/local/lib/python2.7/dist-packages/django/template/base.py in __init__, line 695
Python Executable:      /usr/bin/python
Python Version: 2.7.6

did you any good man catch this evil bug, please?

Change History (1)

comment:1 by micfan, 10 years ago

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top