From caa2d0cbbd185737ea7f4dbe8dd1268152c24aa4 Mon Sep 17 00:00:00 2001 From: Victoria A <52001888+adjeiv@users.noreply.github.com> Date: Wed, 29 Nov 2023 22:07:38 +0000 Subject: [PATCH] Move line so any exceptions are caught --- optuna_dashboard/_app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/optuna_dashboard/_app.py b/optuna_dashboard/_app.py index f10d051f..b91ce5f0 100644 --- a/optuna_dashboard/_app.py +++ b/optuna_dashboard/_app.py @@ -152,6 +152,7 @@ def create_app( storage=storage, study_name=dst_study_name, directions=src_study.directions ) dst_study.add_trials(src_study.get_trials(deepcopy=False)) + note.copy_notes(storage, src_study, dst_study) except DuplicatedStudyError: response.status = 400 # Bad request return {"reason": f"study_name={dst_study_name} is duplicaated"} @@ -165,7 +166,6 @@ def create_app( response.status = 500 return {"reason": "Failed to load the new study"} - note.copy_notes(storage, src_study, dst_study) storage.delete_study(src_study._study_id) response.status = 201 return serialize_study_summary(new_study_summary)