From b00a6c29f92f2de3d19940592200864d7c4bde42 Mon Sep 17 00:00:00 2001 From: Jacob Kaplan-Moss Date: Wed, 5 Apr 2006 17:35:18 +0000 Subject: [PATCH] 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 --- django/utils/feedgenerator.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/django/utils/feedgenerator.py b/django/utils/feedgenerator.py index 22db5abe7f..cd5ff7abc9 100644 --- a/django/utils/feedgenerator.py +++ b/django/utils/feedgenerator.py @@ -158,9 +158,11 @@ class Rss201rev2Feed(RssFeed): handler.addQuickElement(u"description", item['description']) # Author information. - if item['author_email'] is not None and item['author_name'] is not None: - handler.addQuickElement(u"author", u"%s (%s)" % \ + if item["author_name"] and item["author_email"]: + handler.addQuickElement(u"author", "%s (%s)" % \ (item['author_email'], item['author_name'])) + elif item["author_email"]: + handler.addQuickElement(u"author", item["author_email"]) if item['pubdate'] is not None: handler.addQuickElement(u"pubDate", rfc2822_date(item['pubdate']).decode('ascii'))