Opened 13 years ago

Closed 12 years ago

Last modified 10 years ago

#10552 closed (duplicate)

Built-in template fails "lowdly" with exception

Reported by: Evgeniy Ivanov Owned by: nobody
Component: Template system Version: dev
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


length_is filter causes an exception if it's used with None intead of something that has len() method. According to docs this should never happen (tags and filters fails silently).

Exception Value:  	

Caught an exception while rendering: object of type 'NoneType' has no len()

Original Traceback (most recent call last):
  File "/usr/local/lib/python2.5/site-packages/django/template/", line 71, in render_node
    result = node.render(context)
  File "/usr/local/lib/python2.5/site-packages/django/template/", line 250, in render
    value = bool_expr.resolve(context, True)
  File "/usr/local/lib/python2.5/site-packages/django/template/", line 559, in resolve
    new_obj = func(obj, *arg_vals)
  File "/usr/local/lib/python2.5/site-packages/django/template/", line 523, in length_is
    return len(value) == int(arg)
TypeError: object of type 'NoneType' has no len()

Change History (3)

comment:1 Changed 12 years ago by Jacob

milestone: 1.1
Triage Stage: UnreviewedAccepted

comment:2 Changed 12 years ago by Ramiro Morales

Resolution: duplicate
Status: newclosed

This is a dupe of #8462 and was fixed in r10193/r10194

comment:3 Changed 10 years ago by Jacob

milestone: 1.1

Milestone 1.1 deleted

Note: See TracTickets for help on using tickets.
Back to Top