def run(self): self.validate() try: dashboard = DashboardDAO.update(self._model, self._properties) except DAOUpdateFailedError as e: logger.exception(e.exception) raise DashboardUpdateFailedError() return dashboard
def run(self) -> Model: self.validate() try: dashboard = DashboardDAO.update(self._model, self._properties, commit=False) dashboard = DashboardDAO.update_charts_owners(dashboard, commit=True) except DAOUpdateFailedError as ex: logger.exception(ex.exception) raise DashboardUpdateFailedError() return dashboard
def run(self) -> Model: self.validate() try: dashboard = DashboardDAO.update(self._model, self._properties, commit=False) 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=False, ) db.session.commit() except DAOUpdateFailedError as ex: logger.exception(ex.exception) raise DashboardUpdateFailedError() from ex return dashboard