(project_string_id)
| 10 | methods = ['POST']) |
| 11 | @limiter.limit("20 per day") |
| 12 | def stats_task_api(project_string_id): |
| 13 | spec_list = [{'date_from': str}, |
| 14 | {'date_to': str}, |
| 15 | {'status': str}, |
| 16 | {'job_id': { |
| 17 | "required": False, |
| 18 | "type": int, |
| 19 | }}, |
| 20 | {'mode': str}] |
| 21 | |
| 22 | log, input, untrusted_input = regular_input.master(request = request, |
| 23 | spec_list = spec_list) |
| 24 | if len(log["error"].keys()) >= 1: |
| 25 | return jsonify(log = log), 400 |
| 26 | |
| 27 | with sessionMaker.session_scope() as session: |
| 28 | user = User.get(session) |
| 29 | if input.get('job_id'): |
| 30 | project = Project.get_by_string_id(session, project_string_id = project_string_id) |
| 31 | stats = stats_task_core(session = session, |
| 32 | project = project, |
| 33 | date_from = input['date_from'], |
| 34 | date_to = input['date_to'], |
| 35 | status = input['status'], |
| 36 | job_id = input['job_id']) |
| 37 | else: |
| 38 | stats = stats_task_core_project(session = session, |
| 39 | project_string_id = project_string_id, |
| 40 | date_from = input['date_from'], |
| 41 | date_to = input['date_to'], |
| 42 | status = input['status']) |
| 43 | |
| 44 | log['success'] = True |
| 45 | return jsonify(log = log, |
| 46 | stats = stats), 200 |
| 47 | |
| 48 | |
| 49 | @Job_permissions.by_job_id( |
nothing calls this directly
no test coverage detected