diff backend/AbstractFeedUpdater.py @ 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 a3c945ce434c
children e604c32f67aa
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])