diff --git a/ckanext/datapusher/logic/action.py b/ckanext/datapusher/logic/action.py index 7d34b7f42ba..3a49675857e 100644 --- a/ckanext/datapusher/logic/action.py +++ b/ckanext/datapusher/logic/action.py @@ -4,6 +4,7 @@ import json import urlparse import datetime +import time from dateutil.parser import parse as parse_date @@ -287,6 +288,11 @@ def datapusher_status(context, data_dict): 'Authorization': job_key}) r.raise_for_status() job_detail = r.json() + for log in job_detail['logs']: + if 'timestamp' in log: + date = datetime.datetime.strptime(log['timestamp'], "%Y-%m-%dT%H:%M:%S.%f") + date = datetime.datetime.utcfromtimestamp(time.mktime(date.timetuple())) + log['timestamp'] = date except (requests.exceptions.ConnectionError, requests.exceptions.HTTPError): job_detail = {'error': 'cannot connect to datapusher'} diff --git a/ckanext/datapusher/templates/datapusher/resource_data.html b/ckanext/datapusher/templates/datapusher/resource_data.html index 2f3de6075ec..c43bf333450 100644 --- a/ckanext/datapusher/templates/datapusher/resource_data.html +++ b/ckanext/datapusher/templates/datapusher/resource_data.html @@ -72,7 +72,7 @@

{{ _('Upload Log') }}

{{ line | urlize }}
{% endfor %} - {{ h.time_ago_from_timestamp(status.last_updated) }} + {{ h.time_ago_from_timestamp(item.timestamp) }} {{ _('Details') }}