From 11924fcb0d03ad5e12a734b6c0558df9838ab8de Mon Sep 17 00:00:00 2001 From: j Date: Sat, 20 Feb 2016 13:01:49 +0000 Subject: [PATCH] Rename api.taskStatus to api.getTaskStatus still register api.taskStatus since its used in pandora_client and other scripts. fixes #2600 and fixes #2859 --- pandora/annotation/views.py | 6 +++--- pandora/archive/views.py | 5 +++-- static/js/utils.js | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pandora/annotation/views.py b/pandora/annotation/views.py index 0f71c907..b576fb39 100644 --- a/pandora/annotation/views.py +++ b/pandora/annotation/views.py @@ -159,7 +159,7 @@ def addAnnotation(request, data): ... // more annotation properties } see: addAnnotations, editAnnotation, findAnnotations, getAnnotation, - taskStatus, removeAnnotation + getTaskStatus, removeAnnotation ''' for key in ('item', 'layer', 'in', 'out', 'value'): if key not in data: @@ -213,10 +213,10 @@ def addAnnotations(request, data): ] } returns { - taskId: string // task id, use `taskStatus` to poll + taskId: string // task id, use `getTaskStatus` to poll } see: addAnnotation, editAnnotation, findAnnotations, getAnnotation, - taskStatus, removeAnnotation + getTaskStatus, removeAnnotation ''' for key in ('item', 'layer', 'annotations'): if key not in data: diff --git a/pandora/archive/views.py b/pandora/archive/views.py index 48d17c69..1713b229 100644 --- a/pandora/archive/views.py +++ b/pandora/archive/views.py @@ -339,7 +339,7 @@ def direct_upload(request): @login_required_json -def taskStatus(request, data): +def getTaskStatus(request, data): ''' Gets the status for a given task takes { @@ -373,7 +373,8 @@ def taskStatus(request, data): 'traceback': traceback }) return render_to_json_response(response) -actions.register(taskStatus, cache=False) +actions.register(getTaskStatus, cache=False) +actions.register(getTaskStatus, action='taskStatus', cache=False) @login_required_json diff --git a/static/js/utils.js b/static/js/utils.js index 4387cab4..8622b626 100644 --- a/static/js/utils.js +++ b/static/js/utils.js @@ -2647,7 +2647,7 @@ pandora.wait = function(taskId, callback, timeout) { var task = {}; timeout = timeout || 5000; task.timeout = setTimeout(function() { - pandora.api.taskStatus({taskId: taskId}, function(result) { + pandora.api.getTaskStatus({taskId: taskId}, function(result) { var t; if (result.data.status == 'PENDING') { t = pandora.wait(taskId, callback);