mirror of
https://github.com/apache/superset.git
synced 2026-04-21 00:54:44 +00:00
fix(Dashboard): Copying a Dashboard does not commit the transaction (#29776)
This commit is contained in:
@@ -34,10 +34,12 @@ from werkzeug.wsgi import FileWrapper
|
||||
|
||||
from superset import db, is_feature_enabled, thumbnail_cache
|
||||
from superset.charts.schemas import ChartEntityResponseSchema
|
||||
from superset.commands.dashboard.copy import CopyDashboardCommand
|
||||
from superset.commands.dashboard.create import CreateDashboardCommand
|
||||
from superset.commands.dashboard.delete import DeleteDashboardCommand
|
||||
from superset.commands.dashboard.exceptions import (
|
||||
DashboardAccessDeniedError,
|
||||
DashboardCopyError,
|
||||
DashboardCreateFailedError,
|
||||
DashboardDeleteFailedError,
|
||||
DashboardForbiddenError,
|
||||
@@ -1606,9 +1608,11 @@ class DashboardRestApi(BaseSupersetModelRestApi):
|
||||
return self.response_400(message=error.messages)
|
||||
|
||||
try:
|
||||
dash = DashboardDAO.copy_dashboard(original_dash, data)
|
||||
dash = CopyDashboardCommand(original_dash, data).run()
|
||||
except DashboardForbiddenError:
|
||||
return self.response_403()
|
||||
except DashboardCopyError:
|
||||
return self.response_400()
|
||||
|
||||
return self.response(
|
||||
200,
|
||||
|
||||
Reference in New Issue
Block a user