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

skf/api/projects/endpoints/project_items.py (2 issues)

Severity
1
2
from flask import request
0 ignored issues
show
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
0 ignored issues
show
Unused select_userid_jwt imported from skf.api.security
Loading history...
5
from skf.api.projects.business import get_project_items
6
from skf.api.projects.serializers import page_of_project_items, message
7
from skf.api.projects.parsers import authorization
8
from skf.api.restplus import api
9
10
ns = api.namespace('project', description='Operations related to project items')
11
12
13
@ns.route('/items')
14
@api.response(404, 'Validation error', message)
15
class ProjectCollection(Resource):
16
17
    @api.expect(authorization)
18
    @api.marshal_with(page_of_project_items)
19
    @api.response(400, 'No results found', message)
20
    def get(self):
21
        """
22
        Returns list of project items.
23
        * Privileges required: **read**
24
        """
25
        validate_privilege(self, 'read')
26
        result = get_project_items()        
27
        return result, 200, security_headers()
28
29