Completed
Push — master ( 739b7a...711b3d )
by Glenn
01:21
created

ProjectSprintResultAuditExportItem.get()   A

Complexity

Conditions 1

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 12
rs 9.4285
cc 1
1
2
from flask import request
0 ignored issues
show
Unused Code introduced by Martin Marsicano
Unused request imported from flask
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
Unused Code introduced by Martin Marsicano
Unused sprint_results imported from skf.api.sprints.serializers
Loading history...
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