1 | |||
2 | from flask import request |
||
0 ignored issues
–
show
Unused Code
introduced
by
Loading history...
|
|||
3 | from flask_restplus import Resource |
||
4 | from skf.api.security import security_headers, validate_privilege, select_userid_jwt |
||
5 | from skf.api.sprints.business import get_sprint_results_audit_export |
||
6 | from skf.api.sprints.serializers import sprint_results, message |
||
0 ignored issues
–
show
|
|||
7 | from skf.api.sprints.parsers import authorization |
||
8 | from skf.api.restplus import api |
||
9 | |||
10 | ns = api.namespace('sprint', description='Operations related to sprint items') |
||
11 | |||
12 | |||
13 | @ns.route('/results/export/<int:id>') |
||
14 | @api.doc(params={'id': 'The sprint id'}) |
||
15 | @api.response(404, 'Validation error', message) |
||
16 | class ProjectSprintResultAuditExportItem(Resource): |
||
17 | |||
18 | @api.expect(authorization) |
||
19 | @api.marshal_with(message, 'Null') |
||
20 | @api.response(400, 'No results found', message) |
||
21 | def get(self, id): |
||
22 | """ |
||
23 | Returns sprint export. |
||
24 | * Privileges required: **read** |
||
25 | """ |
||
26 | validate_privilege(self, 'read') |
||
27 | user_id = select_userid_jwt(self) |
||
28 | result = get_sprint_results_audit_export(id, user_id) |
||
29 | return result, 200, security_headers() |
||
30 |