Django

Code

Changeset 8221

Show
Ignore:
Timestamp:
08/05/08 18:52:03 (4 months ago)
Author:
jacob
Message:

Fixed #8128: correctly handle feeds that incorrectly don't provide pubdates. Be liberal in what you accept!

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/contrib/syndication/feeds.py

    r8216 r8221  
    142142 
    143143            # Round the timezone offset to the nearest half hour. 
    144             tzOffsetMinutes = sign * ((tzDifference.seconds / 60 + 15) / 30) * 30 
    145             tzOffset = timedelta(minutes=tzOffsetMinutes) 
    146             pubdate = pubdate.replace(tzinfo=FixedOffset(tzOffset)) 
     144            if pubdate: 
     145                tzOffsetMinutes = sign * ((tzDifference.seconds / 60 + 15) / 30) * 30 
     146                tzOffset = timedelta(minutes=tzOffsetMinutes) 
     147                pubdate = pubdate.replace(tzinfo=FixedOffset(tzOffset)) 
    147148 
    148149            feed.add_item(