Code

Ticket #9800: rss-add-isPermaLink-element.diff

File rss-add-isPermaLink-element.diff, 709 bytes (added by akoha, 5 years ago)

Here's the patch.

Line 
1diff --git a/django/utils/feedgenerator.py b/django/utils/feedgenerator.py
2--- a/django/utils/feedgenerator.py
3+++ b/django/utils/feedgenerator.py
4@@ -242,7 +242,10 @@
5         if item['comments'] is not None:
6             handler.addQuickElement(u"comments", item['comments'])
7         if item['unique_id'] is not None:
8-            handler.addQuickElement(u"guid", item['unique_id'])
9+            if item['link'] is not None:
10+                handler.addQuickElement(u"guid", item['unique_id'], {u"isPermaLink": "false"})
11+            else:
12+                handler.addQuickElement(u"guid", item['unique_id'])
13         if item['ttl'] is not None:
14             handler.addQuickElement(u"ttl", item['ttl'])
15