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

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8221 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jacob Kaplan-Moss 2008-08-05 23:52:03 +00:00
parent 1f6d33586c
commit 9f6ab8104c
1 changed files with 4 additions and 3 deletions

View File

@ -141,6 +141,7 @@ class Feed(object):
tzDifference = (now - utcnow) tzDifference = (now - utcnow)
# Round the timezone offset to the nearest half hour. # Round the timezone offset to the nearest half hour.
if pubdate:
tzOffsetMinutes = sign * ((tzDifference.seconds / 60 + 15) / 30) * 30 tzOffsetMinutes = sign * ((tzDifference.seconds / 60 + 15) / 30) * 30
tzOffset = timedelta(minutes=tzOffsetMinutes) tzOffset = timedelta(minutes=tzOffsetMinutes)
pubdate = pubdate.replace(tzinfo=FixedOffset(tzOffset)) pubdate = pubdate.replace(tzinfo=FixedOffset(tzOffset))