Code

Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#554 closed defect (fixed)

RSS feeds are not valid due to missing timezone in pubdates

Reported by: hugo <gb@…> Owned by: adrian
Component: contrib.syndication Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

When the RSS feed includes the pubDate tag and that is taken from a datetime field of a model, the strftime(...) stuff creates a date without timezone - that's because %Z doesn't seem to be implemented with datetime.strftime. Instead of the timezone an emtpy string is returned and so the feed validator doesn't see this feed as valid.

Attachments (1)

feedgenerator_patch.txt (1.5 KB) - added by ismael@… 9 years ago.
path file

Download all attachments as: .zip

Change History (3)

Changed 9 years ago by ismael@…

path file

comment:1 Changed 9 years ago by ismael@…

To make the date RSS-valid is posible to use module email
email.Utils.formatdate

+    def rfc2822Date( self, date ):        
+        return email.Utils.formatdate( time.mktime( date.timetuple() ) )

         if item['pubdate'] is not None:
+            handler.addQuickElement(u"pubDate", self.rfc2822Date(item['pubdate']), {})

comment:2 Changed 8 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

(In [1194]) Completely refactored legacy RSS framework to the new django.contrib.syndication package. Also added Atom support, changed the way feeds are registered and added documentation for the whole lot. This is backwards-incompatible, but the RSS framework had not yet been documented, so this should only affect tinkerers and WorldOnline. Fixes #329, #498, #502 and #554. Thanks for various patches/ideas to alastair, ismael, hugo, eric moritz and garthk

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.