Small updates in progress management
authorThierry Florac <tflorac@ulthar.net>
Fri, 01 Mar 2019 13:08:47 +0100
changeset 334 9bb7be798aa6
parent 333 59367a4f8096
child 335 53bc85384db2
Small updates in progress management
src/pyams_utils/progress.py
--- a/src/pyams_utils/progress.py	Fri Feb 22 12:39:24 2019 +0100
+++ b/src/pyams_utils/progress.py	Fri Mar 01 13:08:47 2019 +0100
@@ -12,19 +12,15 @@
 
 __docformat__ = 'restructuredtext'
 
-
-# import standard library
 from datetime import datetime
 from threading import local
 
-# import interfaces
-
-# import packages
 from beaker import cache
-from pyams_utils.lock import locked
 from pyramid.httpexceptions import HTTPBadRequest
 from pyramid.view import view_config
 
+from pyams_utils.lock import locked
+
 
 _local = local()
 
@@ -84,7 +80,7 @@
               'tags': tags,
               'length': length,
               'current': current,
-              'started': datetime.utcnow()}
+              'started': datetime.utcnow().isoformat()}
     # Store task status
     cache_key = PROGRESS_TASK_KEY.format(progress_id)
     progress_cache = get_progress_cache()
@@ -136,7 +132,7 @@
     progress_cache.set_value(cache_key, task_status)
 
 
-@view_config(name='get_progress_status.json', renderer='JSON', xhr=True)
+@view_config(name='get-progress-status.json', renderer='json', xhr=True)
 def get_progress_status_view(request):
     """Get progress status of a given task