Error handling: Do we want a pattern of looking at logs or the input item... depends maybe both depends on context
(project_string_id)
| 19 | 'security_email_verified']) |
| 20 | @limiter.limit("4 per second") |
| 21 | def api_project_upload_large(project_string_id): |
| 22 | """ |
| 23 | Error handling: Do we want a pattern of looking at logs |
| 24 | or the input item... depends maybe both depends on context |
| 25 | """ |
| 26 | |
| 27 | with sessionMaker.session_scope() as session: |
| 28 | |
| 29 | project = Project.get(session, project_string_id) |
| 30 | member = get_member(session) |
| 31 | upload = Upload( |
| 32 | session = session, |
| 33 | project = project, |
| 34 | request = request, |
| 35 | member = member) |
| 36 | |
| 37 | upload.route_from_unique_id() |
| 38 | if len(upload.log["error"].keys()) >= 1: |
| 39 | return jsonify(log = upload.log), 400 |
| 40 | |
| 41 | upload.process_chunk( |
| 42 | request = upload.request, |
| 43 | input = upload.input) |
| 44 | |
| 45 | if len(upload.log["error"].keys()) >= 1: |
| 46 | return jsonify(log = upload.log), 400 |
| 47 | |
| 48 | more_chunks_expected: bool = int(upload.dzchunkindex) + 1 != int(upload.dztotalchunkcount) |
| 49 | |
| 50 | if more_chunks_expected is False and upload.input is not None: |
| 51 | regular_methods.commit_with_rollback(session) |
| 52 | upload.start_media_processing(input = upload.input) |
| 53 | |
| 54 | return jsonify(success = True), 200 |
| 55 | |
| 56 | |
| 57 | @routes.route('/api/walrus/v1/project/<string:project_string_id>/input/from_local', |
nothing calls this directly
no test coverage detected