File tree Expand file tree Collapse file tree 1 file changed +12
-15
lines changed
epictrack-api/src/api/resources Expand file tree Collapse file tree 1 file changed +12
-15
lines changed Original file line number Diff line number Diff line change @@ -39,21 +39,18 @@ class Projects(Resource):
39
39
@profiletime
40
40
def get ():
41
41
"""Return all projects."""
42
- try :
43
- with_works = request .args .get (
44
- 'with_works' ,
45
- default = False ,
46
- type = lambda v : v .lower () == 'true'
47
- )
48
- projects = ProjectService .find_all (with_works )
49
- return_type = request .args .get ("return_type" , None )
50
- if return_type == "list_type" :
51
- schema = res .ListTypeResponseSchema (many = True )
52
- else :
53
- schema = res .ProjectResponseSchema (many = True )
54
- return jsonify (schema .dump (projects )), HTTPStatus .OK
55
- except Exception as e :
56
- return jsonify ({"message" : str (e )}), HTTPStatus .INTERNAL_SERVER_ERROR
42
+ with_works = request .args .get (
43
+ 'with_works' ,
44
+ default = False ,
45
+ type = lambda v : v .lower () == 'true'
46
+ )
47
+ projects = ProjectService .find_all (with_works )
48
+ return_type = request .args .get ("return_type" , None )
49
+ if return_type == "list_type" :
50
+ schema = res .ListTypeResponseSchema (many = True )
51
+ else :
52
+ schema = res .ProjectResponseSchema (many = True )
53
+ return jsonify (schema .dump (projects )), HTTPStatus .OK
57
54
58
55
@staticmethod
59
56
@cors .crossdomain (origin = "*" )
You can’t perform that action at this time.
0 commit comments