(project_string_id)
| 42 | @routes.route('/api/v1/project/<string:project_string_id>/task/list', methods = ['POST']) |
| 43 | @Project_permissions.user_has_project(["admin", "annotator", "Editor", "Viewer"]) |
| 44 | def task_list_api(project_string_id): |
| 45 | spec_list = [{'date_from': None}, |
| 46 | {'date_to': None}, |
| 47 | {'status': None}, |
| 48 | {'page_number': None}, |
| 49 | {'job_id': {'required': False, 'kind': int}}, |
| 50 | {'all_my_jobs': {'required': False, 'kind': bool}}, |
| 51 | {'issues_filter': None}, |
| 52 | {'project_string_id': None}, |
| 53 | {'project_id': { |
| 54 | 'required': False, |
| 55 | 'kind': int |
| 56 | }}, |
| 57 | {'file_id': { |
| 58 | 'required': False, |
| 59 | 'kind': int |
| 60 | }}, |
| 61 | {'incoming_directory_id': None}, |
| 62 | {'limit_count': {'required': False, 'kind': int, 'default': 10}}, |
| 63 | {'mode_data': str}] |
| 64 | |
| 65 | log, input, untrusted_input = regular_input.master(request = request, |
| 66 | spec_list = spec_list) |
| 67 | with sessionMaker.session_scope() as session: |
| 68 | if len(log["error"].keys()) >= 1: |
| 69 | return jsonify(log = log), 400 |
| 70 | # For now we are not supporting querying the entire file list of a project. |
| 71 | # So we check we have either a job ID or a FileID to filter with |
| 72 | if input['file_id'] is None and input['job_id'] is None and input.get('all_my_jobs') is None: |
| 73 | log['error']['file_id'] = 'Please Provide a file ID' |
| 74 | log['error']['job_id'] = 'Please Provide a job ID' |
| 75 | return jsonify(log = log), 400 |
| 76 | member = get_member(session) |
| 77 | project = Project.get_by_string_id(session, project_string_id = project_string_id) |
| 78 | return _task_list_api(session = session, project_id = project.id, input = input, log = log, member = member) |
| 79 | |
| 80 | |
| 81 | def _task_list_api(session, project_id, input = input, member = None, log = regular_log.default()): |
nothing calls this directly
no test coverage detected