()
| 10 | methods = ['POST']) |
| 11 | @General_permissions.grant_permission_for(['normal_user', 'super_admin']) |
| 12 | def project_list_api(): |
| 13 | spec_list = [{'username': None}] |
| 14 | |
| 15 | log, input, untrusted_input = regular_input.master(request = request, |
| 16 | spec_list = spec_list) |
| 17 | if len(log["error"].keys()) >= 1: |
| 18 | return jsonify(log = log), 400 |
| 19 | |
| 20 | with sessionMaker.session_scope() as session: |
| 21 | # TODO this is a placeholder for future thing of getting projects |
| 22 | # by username |
| 23 | # But for now default case is getting logged in users project |
| 24 | # So we just use User.get() |
| 25 | |
| 26 | user = User.get(session = session) |
| 27 | |
| 28 | project_list = project_list_core(session = session, |
| 29 | user = user) |
| 30 | |
| 31 | log['success'] = True |
| 32 | return jsonify(log = log, |
| 33 | project_list = project_list), 200 |
| 34 | |
| 35 | |
| 36 | def project_list_core(session, |
nothing calls this directly
no test coverage detected