Completed
Push — master ( 7f683c...28f277 )
by Glenn
45s
created

skf/api/checklist/endpoints/checklist_level.py (1 issue)

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
5
from skf.api.checklist.business import get_checklist_items_lvl
6
from skf.api.checklist.serializers import checklist_items, message
7
from skf.api.restplus import api
8
9
ns = api.namespace('checklist', description='Operations related to checklist items')
10
11
12
@ns.route('/level/<int:id>')
13
@api.doc(params={'id': 'The checklist level id'})
14
@api.response(404, 'Validation error', message)
15
class ChecklistItem(Resource):
16
17
    @api.marshal_list_with(checklist_items)
18
    @api.response(400, 'No results found', message)
19
    def get(self, id):
20
        """
21
        Returns list of checklist items based on level.
22
        * Privileges required: **none**
23
        """
24
        lvl = id
25
        result = get_checklist_items_lvl(lvl)
26
        return result, 200, security_headers()
27