aboutsummaryrefslogtreecommitdiff
path: root/src/web/lib/article_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/web/lib/article_utils.py')
-rw-r--r--src/web/lib/article_utils.py6
1 files changed, 5 insertions, 1 deletions
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
bgstack15