Ticket #11783: humanize_ordinal_TypeError.diff

File humanize_ordinal_TypeError.diff, 562 bytes (added by realpolitik, 6 years ago)

humanize ordinal TypeError? fix (updated)

  • django/contrib/humanize/templatetags/humanize.py

     
    1414    """
    1515    try:
    1616        value = int(value)
    17     except ValueError:
     17    except (TypeError, ValueError):
    1818        return value
    1919    t = (_('th'), _('st'), _('nd'), _('rd'), _('th'), _('th'), _('th'), _('th'), _('th'), _('th'))
    2020    if value % 100 in (11, 12, 13): # special case
Back to Top