Skip to content

Commit

Permalink
Fixed #8128: correctly handle feeds that incorrectly don't provide pu…
Browse files Browse the repository at this point in the history
…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
jacobian committed Aug 5, 2008
1 parent 1f6d335 commit 9f6ab81
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions django/contrib/syndication/feeds.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -141,9 +141,10 @@ def get_feed(self, url=None):
tzDifference = (now - utcnow) tzDifference = (now - utcnow)


# Round the timezone offset to the nearest half hour. # Round the timezone offset to the nearest half hour.
tzOffsetMinutes = sign * ((tzDifference.seconds / 60 + 15) / 30) * 30 if pubdate:
tzOffset = timedelta(minutes=tzOffsetMinutes) tzOffsetMinutes = sign * ((tzDifference.seconds / 60 + 15) / 30) * 30
pubdate = pubdate.replace(tzinfo=FixedOffset(tzOffset)) tzOffset = timedelta(minutes=tzOffsetMinutes)
pubdate = pubdate.replace(tzinfo=FixedOffset(tzOffset))


feed.add_item( feed.add_item(
title = title_tmp.render(RequestContext(self.request, {'obj': item, 'site': current_site})), title = title_tmp.render(RequestContext(self.request, {'obj': item, 'site': current_site})),
Expand Down

0 comments on commit 9f6ab81

Please sign in to comment.