#2127: date, time, and timesince filters don't fail silently
-------------------------------------------------+--------------------------
 Reporter:  Gary Wilson <[EMAIL PROTECTED]>  |       Owner:  adrian
     Type:  defect                               |      Status:  new   
 Priority:  normal                               |   Milestone:        
Component:  Template system                      |     Version:  SVN   
 Severity:  normal                               |    Keywords:        
-------------------------------------------------+--------------------------
 if you have something like
 {{{
 {{ event.due_date|date:"F j, Y" }}
 }}}
 in your template, and the date/time field is None, then the template will
 raise `AttributeError`:
 {{{
 Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/django/template/__init__.py" in
 render_node
    698. result = node.render(context)
  File "/usr/lib/python2.4/site-packages/django/template/defaulttags.py" in
 render
    113. nodelist.append(node.render(context))
  File "/usr/lib/python2.4/site-packages/django/template/__init__.py" in
 render
    744. output = self.filter_expression.resolve(context)
  File "/usr/lib/python2.4/site-packages/django/template/__init__.py" in
 resolve
    556. obj = func(obj, *arg_vals)
  File "/usr/lib/python2.4/site-packages/django/template/defaultfilters.py"
 in date
    356. return format(value, arg)
  File "/usr/lib/python2.4/site-packages/django/utils/dateformat.py" in
 format
    252. return df.format(format_string)
  File "/usr/lib/python2.4/site-packages/django/utils/dateformat.py" in
 format
    27. pieces.append(str(getattr(self, piece)()))
  File "/usr/lib/python2.4/site-packages/django/utils/dateformat.py" in F
    123. return MONTHS[self.data.month]
 
    AttributeError at /home/
    'NoneType' object has no attribute 'month'
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/2127>
Django <http://code.djangoproject.org/>
The web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates
-~----------~----~----~----~------~----~------~--~---

Reply via email to