From b010aca0a9a811454d36e96b58e8d346c64ed85a Mon Sep 17 00:00:00 2001 From: j Date: Wed, 15 Jun 2016 15:45:51 +0200 Subject: [PATCH] s/taskId/id/ --- pandora/archive/views.py | 10 ++++++---- static/js/utils.js | 6 +++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/pandora/archive/views.py b/pandora/archive/views.py index 012a9d67..ec12a9a2 100644 --- a/pandora/archive/views.py +++ b/pandora/archive/views.py @@ -344,17 +344,19 @@ def getTaskStatus(request, data): ''' Gets the status for a given task takes { - taskId: string // taskId + id: string // taskId } returns { - taskId: string, // taskId + id: string, // taskId status: string, // status, 'PENDING' or 'OK' - result: object // result data + result: object // result data } notes: To be deprecated, will be wrapped in regular API call. ''' #FIXME: should check if user has permissions to get status - if 'taskId' in data: + if 'id' in data: + task_id = data['id'] + elif 'taskId' in data: task_id = data['taskId'] else: task_id = data['task_id'] diff --git a/static/js/utils.js b/static/js/utils.js index d862168e..8675753b 100644 --- a/static/js/utils.js +++ b/static/js/utils.js @@ -2645,14 +2645,14 @@ pandora.updateStatus = function(item) { } }; -pandora.wait = function(taskId, callback, timeout) { +pandora.wait = function(id, callback, timeout) { var task = {}; timeout = timeout || 5000; task.timeout = setTimeout(function() { - pandora.api.getTaskStatus({taskId: taskId}, function(result) { + pandora.api.getTaskStatus({id: id}, function(result) { var t; if (result.data.status == 'PENDING') { - t = pandora.wait(taskId, callback); + t = pandora.wait(id, callback); task.timeout = t.timeout; } else { callback(result);