1
0
mirror of https://github.com/django/django.git synced 2025-07-04 17:59:13 +00:00

magic-removal: fixed #1572 -- feedgenerator RSSv2 feeds now support missing author names (thanks, limodou)

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2617 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jacob Kaplan-Moss 2006-04-05 17:35:18 +00:00
parent 924d9e2f6a
commit b00a6c29f9

View File

@ -158,9 +158,11 @@ class Rss201rev2Feed(RssFeed):
handler.addQuickElement(u"description", item['description']) handler.addQuickElement(u"description", item['description'])
# Author information. # Author information.
if item['author_email'] is not None and item['author_name'] is not None: if item["author_name"] and item["author_email"]:
handler.addQuickElement(u"author", u"%s (%s)" % \ handler.addQuickElement(u"author", "%s (%s)" % \
(item['author_email'], item['author_name'])) (item['author_email'], item['author_name']))
elif item["author_email"]:
handler.addQuickElement(u"author", item["author_email"])
if item['pubdate'] is not None: if item['pubdate'] is not None:
handler.addQuickElement(u"pubDate", rfc2822_date(item['pubdate']).decode('ascii')) handler.addQuickElement(u"pubDate", rfc2822_date(item['pubdate']).decode('ascii'))