Pablo made a proper button to call the /create task url

This commit is contained in:
2016-09-21 15:14:19 +02:00
parent 8470efbcf1
commit 87f6226cf6
2 changed files with 3 additions and 4 deletions

View File

@@ -71,9 +71,8 @@ def save(project, task_id):
return flask.jsonify({'task_id': task_id, 'etag': task._etag, 'time': task._updated }) return flask.jsonify({'task_id': task_id, 'etag': task._etag, 'time': task._updated })
# TODO: remove GET method once Pablo has made a proper button to call this URL with a POST. @perproject_blueprint.route('/create', methods=['POST'])
@perproject_blueprint.route('/create', methods=['POST', 'GET']) @perproject_blueprint.route('/create/<task_type>', methods=['POST'])
@perproject_blueprint.route('/create/<task_type>', methods=['POST', 'GET'])
@attract_project_view() @attract_project_view()
def create_task(project, task_type=None): def create_task(project, task_type=None):
task = current_attract.task_manager.create_task(project, task_type=task_type) task = current_attract.task_manager.create_task(project, task_type=task_type)

View File

@@ -64,7 +64,7 @@ script.
function task_create() { function task_create() {
var base_url = "{{ url_for('attract.tasks.perproject.create_task', project_url=project.url) }}"; var base_url = "{{ url_for('attract.tasks.perproject.create_task', project_url=project.url) }}";
$.get(base_url, function(task_data) { $.post(base_url, function(task_data) {
task_open(task_data.task_id); task_open(task_data.task_id);