From 85d1718ec356c137e5c564b3d482f9ffe84ae7be Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Sun, 14 Feb 2016 15:35:57 +0100 Subject: Fixed a bug when existing_article.updated_date is None. --- src/crawler/classic_crawler.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/crawler') diff --git a/src/crawler/classic_crawler.py b/src/crawler/classic_crawler.py index 249c8343..ec5b14b8 100644 --- a/src/crawler/classic_crawler.py +++ b/src/crawler/classic_crawler.py @@ -132,6 +132,8 @@ async def insert_database(user, feed): new_updated_date = dateutil.parser.parse(article['updated']) except Exception as e: print(e)#new_updated_date = existing_article.date + if None is existing_article.updated_date: + existing_article.updated_date = new_updated_date.replace(tzinfo=None) if existing_article.updated_date.strftime('%Y-%m-%dT%H:%M:%S') != \ new_updated_date.strftime('%Y-%m-%dT%H:%M:%S'): existing_article.updated_date = \ -- cgit