aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2016-02-14 15:35:57 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2016-02-14 15:35:57 +0100
commit85d1718ec356c137e5c564b3d482f9ffe84ae7be (patch)
tree15cbaf38dbd7c65312036e2d4529b0ba6c5c80f8
parentUpdated Vagrant default configuration file. (diff)
downloadnewspipe-85d1718ec356c137e5c564b3d482f9ffe84ae7be.tar.gz
newspipe-85d1718ec356c137e5c564b3d482f9ffe84ae7be.tar.bz2
newspipe-85d1718ec356c137e5c564b3d482f9ffe84ae7be.zip
Fixed a bug when existing_article.updated_date is None.
-rw-r--r--src/crawler/classic_crawler.py2
1 files changed, 2 insertions, 0 deletions
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 = \
bgstack15