return mode return_type, string in ['url', 'data'] That's why it's 'data' because the "FORMAT" could be JSON too.
(project_string_id)
| 48 | @routes.route('/api/walrus/project/<string:project_string_id>' + '/export/link', methods=['POST']) |
| 49 | @Project_permissions.user_has_project(["admin", "Editor", "Viewer"]) |
| 50 | def export_link(project_string_id): |
| 51 | """ |
| 52 | |
| 53 | return mode |
| 54 | |
| 55 | return_type, string in ['url', 'data'] |
| 56 | |
| 57 | That's why it's 'data' because the "FORMAT" could be JSON too. |
| 58 | |
| 59 | |
| 60 | """ |
| 61 | spec_list = [ |
| 62 | {"id": int}, |
| 63 | {"format": { |
| 64 | 'default': 'JSON', |
| 65 | 'kind': str, |
| 66 | 'valid_values_list': ['JSON', 'YAML'] |
| 67 | } |
| 68 | }, |
| 69 | {"return_type": { |
| 70 | 'default': 'url', |
| 71 | 'kind': str, |
| 72 | 'valid_values_list': ['url', 'data'] |
| 73 | } |
| 74 | } |
| 75 | ] |
| 76 | |
| 77 | log, input, untrusted_input = regular_input.master(request=request, |
| 78 | spec_list=spec_list) |
| 79 | if len(log["error"].keys()) >= 1: |
| 80 | return jsonify(log=log), 400 |
| 81 | |
| 82 | with sessionMaker.session_scope() as session: |
| 83 | |
| 84 | export = session.query(Export).filter( |
| 85 | Export.id == input['id']).first() |
| 86 | |
| 87 | export_check_result = check_export_permissions_and_status(export, project_string_id, session) |
| 88 | if regular_log.log_has_error(export_check_result): |
| 89 | return jsonify(export_check_result), 400 |
| 90 | |
| 91 | result = export_view_core( |
| 92 | export=export, |
| 93 | format=input['format'], |
| 94 | return_type=input['return_type']) |
| 95 | |
| 96 | return jsonify(result), 200 |
| 97 | |
| 98 | @routes.route('/api/walrus/project/<string:project_string_id>' + |
| 99 | '/export/<int:export_id>/status', |
nothing calls this directly
no test coverage detected