(project_string_id)
| 10 | "Editor", |
| 11 | "Viewer"]) |
| 12 | def project_view(project_string_id): |
| 13 | """ |
| 14 | |
| 15 | """ |
| 16 | |
| 17 | with sessionMaker.session_scope() as session: |
| 18 | project = Project.get_project(session, project_string_id) |
| 19 | |
| 20 | if project.deletion_pending == True: |
| 21 | return jsonify("Project scheduled for deletion"), 200 |
| 22 | |
| 23 | if project is not None: |
| 24 | # not super happy with permission thing being here |
| 25 | |
| 26 | # If the project is public and use is not logged in |
| 27 | # there won't be a permission to attach here right? |
| 28 | user = User.get(session) |
| 29 | user_permission_level = None |
| 30 | if user: |
| 31 | user_permission_level = user.serialize_with_permission_only(project_string_id) |
| 32 | |
| 33 | # TODO move this into Project class? |
| 34 | if project.is_public is True: |
| 35 | project_serialized = project.serialize_public(session) |
| 36 | else: |
| 37 | project_serialized = project.serialize() |
| 38 | ### |
| 39 | |
| 40 | out = jsonify(user_permission_level = user_permission_level, |
| 41 | project = project_serialized) |
| 42 | else: |
| 43 | out = jsonify({"none_found": True}) |
| 44 | |
| 45 | return out, 200, {'ContentType': 'application/json'} |
| 46 | |
| 47 | |
| 48 | @routes.route('/api/project/<string:project_string_id>/checks', |
nothing calls this directly
no test coverage detected