Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #8128: correctly handle feeds that incorrectly don't provide pu…

…bdates. Be liberal in what you accept!

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8221 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 9f6ab8104c72d4b8f56ecc8280606cae959ae126 1 parent 1f6d335
Jacob Kaplan-Moss jacobian authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 django/contrib/syndication/feeds.py
7 django/contrib/syndication/feeds.py
View
@@ -141,9 +141,10 @@ def get_feed(self, url=None):
tzDifference = (now - utcnow)
# Round the timezone offset to the nearest half hour.
- tzOffsetMinutes = sign * ((tzDifference.seconds / 60 + 15) / 30) * 30
- tzOffset = timedelta(minutes=tzOffsetMinutes)
- pubdate = pubdate.replace(tzinfo=FixedOffset(tzOffset))
+ if pubdate:
+ tzOffsetMinutes = sign * ((tzDifference.seconds / 60 + 15) / 30) * 30
+ tzOffset = timedelta(minutes=tzOffsetMinutes)
+ pubdate = pubdate.replace(tzinfo=FixedOffset(tzOffset))
feed.add_item(
title = title_tmp.render(RequestContext(self.request, {'obj': item, 'site': current_site})),
Please sign in to comment.
Something went wrong with that request. Please try again.