Skip to content

Commit

Permalink
POST to the right URI
Browse files Browse the repository at this point in the history
  • Loading branch information
ihodes committed Jun 1, 2015
1 parent 43f3486 commit 4235541
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cycledash/templates/tasks.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ <h4>{{ task.type }}: {{ task.state }}</h4>
$('#restart').on('click', function(e) {
if (window.confirm('Are you sure you want to restart all failed tasks?')) {
$.ajax({
url: window.location + '/restart',
url: '/api/runs/{{run_id}}/tasks/restart',
type: 'POST'
}).done(function() {
window.location = '/runs';
window.location = '/';
}).fail(function(e) {
console.error(e);
alert('Something went wrong. ' + e);
Expand Down
2 changes: 1 addition & 1 deletion cycledash/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def tasks(run_id):
# pylint: disable=too-many-function-args
'traceback': worker.AsyncResult(task_id).traceback}
for task_id, typ, state in tasks.execute().fetchall()]
return render_template('tasks.html', tasks=tasks)
return render_template('tasks.html', tasks=tasks, run_id=run_id)

@app.route('/runs/<int:run_id>/examine')
def examine(run_id):
Expand Down

0 comments on commit 4235541

Please sign in to comment.