changeset 187:2f2016a10f7d

handle a missing updated_parsed attribute in a feed entry gracefully
author dirk
date Tue, 13 Sep 2011 17:52:36 +0200
parents 6cbd4420c187
children e26210be221f
files backend/AbstractFeedUpdater.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/backend/AbstractFeedUpdater.py	Tue Sep 13 17:43:22 2011 +0200
+++ b/backend/AbstractFeedUpdater.py	Tue Sep 13 17:52:36 2011 +0200
@@ -48,7 +48,8 @@
     def _normalize(self, entry):
         if not hasattr(entry, "id"):
             entry.id = entry.link
-        if not hasattr(entry, "updated_parsed"):
+        if not hasattr(entry, "updated_parsed") or entry.updated_parsed is None:
+            # TODO try to parse the entry.updated date string
             entry.updated_parsed = datetime.today()
         else:
             entry.updated_parsed = datetime(*entry.updated_parsed[:6])