From 0c90ac01d2fd503905f1601959002c89146fc7f7 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Wed, 28 Sep 2016 10:33:05 +0200 Subject: test --- src/web/lib/article_utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/web') diff --git a/src/web/lib/article_utils.py b/src/web/lib/article_utils.py index b5b9f246..71e83880 100644 --- a/src/web/lib/article_utils.py +++ b/src/web/lib/article_utils.py @@ -26,8 +26,12 @@ def extract_id(entry, keys=[('link', 'link'), ('published', 'date'), if entry_key in entry and pyagg_key not in ids: ids[pyagg_key] = entry[entry_key] if 'date' in pyagg_key: - ids[pyagg_key] = dateutil.parser.parse(ids[pyagg_key])\ + try: + ids[pyagg_key] = dateutil.parser.parse(ids[pyagg_key])\ .isoformat() + except ValueError as e: + print("extract_id: " + str(e)) + ids[pyagg_key] = datetime.now().isoformat() return ids -- cgit