(task_id)
| 12 | methods=['POST']) |
| 13 | @Permission_Task.by_task_id(apis_user_list=["builder_or_trainer"]) |
| 14 | def api_by_task_is_complete_toggle(task_id): |
| 15 | with sessionMaker.session_scope() as session: |
| 16 | task = Task.get_by_id( |
| 17 | session = session, |
| 18 | task_id = task_id) |
| 19 | file = task.file |
| 20 | new_file = file.toggle_flag_shared(session) |
| 21 | |
| 22 | if new_file is False: return jsonify(False), 400 |
| 23 | |
| 24 | Event.new( |
| 25 | session = session, |
| 26 | kind = "file_complete_toggle", |
| 27 | member = get_member(session=session), |
| 28 | project_id = task.project_id, |
| 29 | file_id = file.id, |
| 30 | description = f"from_task_{str(file.ann_is_complete)}" |
| 31 | ) |
| 32 | |
| 33 | return jsonify( success = True, |
| 34 | new_file = new_file.serialize_with_type(session)), 200 |
| 35 | |
| 36 | |
| 37 | @routes.route('/api/project/<string:project_string_id>' + |
nothing calls this directly
no test coverage detected