diff --git a/superset/dashboards/commands/update.py b/superset/dashboards/commands/update.py index 5384e4590ca36..2065437cc3b31 100644 --- a/superset/dashboards/commands/update.py +++ b/superset/dashboards/commands/update.py @@ -34,6 +34,7 @@ ) from superset.dashboards.dao import DashboardDAO from superset.exceptions import SupersetSecurityException +from superset.extensions import db from superset.models.dashboard import Dashboard from superset.views.base import check_ownership @@ -51,13 +52,14 @@ def run(self) -> Model: self.validate() try: dashboard = DashboardDAO.update(self._model, self._properties, commit=False) - dashboard = DashboardDAO.update_charts_owners(dashboard, commit=True) + dashboard = DashboardDAO.update_charts_owners(dashboard, commit=False) if self._properties.get("json_metadata"): dashboard = DashboardDAO.set_dash_metadata( dashboard, data=json.loads(self._properties.get("json_metadata", "{}")), - commit=True, + commit=False, ) + db.session.commit() except DAOUpdateFailedError as ex: logger.exception(ex.exception) raise DashboardUpdateFailedError() from ex