(task_id)
| 6 | @routes.route('/api/v1/task/<int:task_id>/complete', methods = ['POST']) |
| 7 | @Permission_Task.by_task_id(apis_user_list = ["builder_or_trainer"]) |
| 8 | def api_task_complete(task_id): |
| 9 | """ |
| 10 | |
| 11 | """ |
| 12 | spec_list = [] |
| 13 | |
| 14 | log, input, untrusted_input = regular_input.master(request = request, |
| 15 | spec_list = spec_list) |
| 16 | if len(log["error"].keys()) >= 1: |
| 17 | return jsonify(log = log), 400 |
| 18 | |
| 19 | with sessionMaker.session_scope() as session: |
| 20 | member = get_member(session = session) |
| 21 | |
| 22 | task_serialized = task_complete_core(session = session, |
| 23 | task_id = task_id, |
| 24 | member = member) |
| 25 | |
| 26 | if task_serialized is False: |
| 27 | log['info']['task'] = "No Task Found" |
| 28 | return jsonify(log = log), 200 |
| 29 | |
| 30 | log['success'] = True |
| 31 | return jsonify(log = log, |
| 32 | task = task_serialized), 200 |
| 33 | |
| 34 | |
| 35 | def task_complete_core(session, |
nothing calls this directly
no test coverage detected