Ticket #14656: 14656.patch

File 14656.patch, 2.2 KB (added by matt@…, 13 years ago)

A Git patch for this bug.

  • django/contrib/syndication/views.py

    From 0b4997410aa8ddeaaefc68657cabd4db8fe60463 Mon Sep 17 00:00:00 2001
    From: Matt Stevens <matt@dirtymonkey.co.uk>
    Date: Wed, 18 Jan 2012 10:22:29 -0500
    Subject: [PATCH] Ticket #14656 Fix
    
    ---
     django/contrib/syndication/views.py |    6 ++++++
     django/utils/feedgenerator.py       |    5 ++++-
     2 files changed, 10 insertions(+), 1 deletions(-)
    
    diff --git a/django/contrib/syndication/views.py b/django/contrib/syndication/views.py
    index dbb9eee..22e8ac5 100644
    a b class Feed(object):  
    168168                ltz = tzinfo.LocalTimezone(pubdate)
    169169                pubdate = pubdate.replace(tzinfo=ltz)
    170170
     171            updated = self.__get_dynamic_attr('item_updated', item)
     172            if updated and is_naive(updated):
     173                ltz = tzinfo.LocalTimezone(updated)
     174                updated = updated.replace(tzinfo=ltz)
     175
    171176            feed.add_item(
    172177                title = title,
    173178                link = link,
    class Feed(object):  
    175180                unique_id = self.__get_dynamic_attr('item_guid', item, link),
    176181                enclosure = enc,
    177182                pubdate = pubdate,
     183                updated = updated,
    178184                author_name = author_name,
    179185                author_email = author_email,
    180186                author_link = author_link,
  • django/utils/feedgenerator.py

    diff --git a/django/utils/feedgenerator.py b/django/utils/feedgenerator.py
    index a49e16b..ad2eb3c 100644
    a b class Atom1Feed(SyndicationFeed):  
    340340        handler.addQuickElement(u"title", item['title'])
    341341        handler.addQuickElement(u"link", u"", {u"href": item['link'], u"rel": u"alternate"})
    342342        if item['pubdate'] is not None:
    343             handler.addQuickElement(u"updated", rfc3339_date(item['pubdate']).decode('utf-8'))
     343            handler.addQuickElement(u"published", rfc3339_date(item['pubdate']).decode('utf-8'))
     344
     345        if item['updated'] is not None:
     346            handler.addQuickElement(u"updated", rfc3339_date(item['updated']).decode('utf-8'))
    344347
    345348        # Author information.
    346349        if item['author_name'] is not None:
Back to Top