Commit d06b4742 authored by Jacob Kaplan-Moss's avatar Jacob Kaplan-Moss
Browse files

Do [8221] in a slightly more clean way.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8222 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent 9f6ab810
Loading
Loading
Loading
Loading
+12 −12
Original line number Diff line number Diff line
@@ -129,6 +129,7 @@ class Feed(object):
                author_email = author_link = None

            pubdate = self.__get_dynamic_attr('item_pubdate', item)
            if pubdate:
                now = datetime.now()
                utcnow = datetime.utcnow()

@@ -141,7 +142,6 @@ class Feed(object):
                    tzDifference = (now - utcnow)

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