Ticket #6686: patch.2.diff

File patch.2.diff, 613 bytes (added by dmartin@…, 17 years ago)

previous patch file was missing 'or None'

  • django/db/backends/util.py

     
    4646###############################################
    4747
    4848def typecast_date(s):
    49     return s and datetime.date(*map(int, s.split('-'))) or None # returns None if s is null
     49    try:
     50        return s and datetime.date(*map(int, s.split('-'))) or None # returns None if s is null
     51    except:
     52        return None
    5053
    5154def typecast_time(s): # does NOT store time zone information
    5255    if not s: return None
Back to Top