Commit 8b40f09e authored by Romain Loth's avatar Romain Loth

upgrade dateparser version to fix occasional bug in europress dates

parent 83d330a0
......@@ -228,22 +228,22 @@ class EuropressParser(Parser):
# 2) we parse the retrieved datestring into a formal date
try:
hyperdata['publication_date'] = dateparser.parse(
the_date = dateparser.parse(
date_str.strip(),
languages=[doc_language],
date_formats=['%d %B %Y','%B %d, %Y']
)
# print("RES POSTPROC:",hyperdata['publication_date'])
except:
hyperdata['publication_date'] = timezone.now().strftime("%Y-%m-%d %H:%M:%S")
the_date = timezone.now()
hyperdata['publication_date'] = the_date.strftime("%Y-%m-%d %H:%M:%S")
# print("RES POSTPROC:",hyperdata['publication_date'])
# infos dérivées
hyperdata['publication_year'] = hyperdata['publication_date'].strftime('%Y')
hyperdata['publication_month'] = hyperdata['publication_date'].strftime('%m')
hyperdata['publication_day'] = hyperdata['publication_date'].strftime('%d')
hyperdata['publication_year'] = the_date.strftime('%Y')
hyperdata['publication_month'] = the_date.strftime('%m')
hyperdata['publication_day'] = the_date.strftime('%d')
# RUBRIQUE
......
......@@ -4,7 +4,7 @@ anyjson==0.3.3
billiard==3.3.0.22 # multiprocessing fork
celery==3.1.20
chardet==2.3.0
dateparser==0.3.2
dateparser==0.3.5
Django==1.9.2
django-celery==3.1.17
django-pgfields==1.4.4
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment