mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-10-30 13:30:17 +08:00
Fix the bug while renaming a study with maximize direction
This commit is contained in:
1 parent
5c5270b4bd
commit
d11d777029
1 file changed
+5
-1
@@ -139,8 +139,12 @@ def create_app(
|
||||
response.status = 404 # Not found
|
||||
return {"reason": f"study_id={study_id} is not found"}
|
||||
|
||||
summary = get_study_summary(storage, study_id)
|
||||
if summary is None:
|
||||
response.status = 500
|
||||
return {"reason": "Failed to load the study"}
|
||||
try:
|
||||
dst_study = optuna.create_study(storage=storage, study_name=dst_study_name)
|
||||
dst_study = optuna.create_study(storage=storage, study_name=dst_study_name, directions=summary.directions)
|
||||
dst_study.add_trials(src_study.get_trials(deepcopy=False))
|
||||
except DuplicatedStudyError:
|
||||
response.status = 400 # Bad request
|
||||
|
||||
Reference in new issue
Block a user