summaryrefslogtreecommitdiff
path: root/django/utils/feedgenerator.py
diff options
context:
space:
mode:
authorNick Pope <nick.pope@flightdataservices.com>2017-12-11 12:08:45 +0000
committerTim Graham <timograham@gmail.com>2017-12-11 07:08:45 -0500
commitd13a9e44ded4e93570c6ba42ec84e45ddca2505b (patch)
tree0df16e6538d8794c39bd62b5a46879b8abe6572c /django/utils/feedgenerator.py
parenta9e5ac823df8ba8b786b6450c967ca378c008d0e (diff)
Fixed #28909 -- Simplified code using tuple/list/set/dict unpacking.
Diffstat (limited to 'django/utils/feedgenerator.py')
-rw-r--r--django/utils/feedgenerator.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/django/utils/feedgenerator.py b/django/utils/feedgenerator.py
index ec01d02697..a0f63901c7 100644
--- a/django/utils/feedgenerator.py
+++ b/django/utils/feedgenerator.py
@@ -102,8 +102,8 @@ class SyndicationFeed:
'feed_copyright': to_str(feed_copyright),
'id': feed_guid or link,
'ttl': to_str(ttl),
+ **kwargs,
}
- self.feed.update(kwargs)
self.items = []
def add_item(self, title, link, description, author_email=None,
@@ -119,7 +119,7 @@ class SyndicationFeed:
return str(s) if s is not None else s
if categories:
categories = [to_str(c) for c in categories]
- item = {
+ self.items.append({
'title': to_str(title),
'link': iri_to_uri(link),
'description': to_str(description),
@@ -135,9 +135,8 @@ class SyndicationFeed:
'categories': categories or (),
'item_copyright': to_str(item_copyright),
'ttl': to_str(ttl),
- }
- item.update(kwargs)
- self.items.append(item)
+ **kwargs,
+ })
def num_items(self):
return len(self.items)