diff --git a/superset/reports/commands/execute.py b/superset/reports/commands/execute.py index 61f72d4790e..f5f7bf41302 100644 --- a/superset/reports/commands/execute.py +++ b/superset/reports/commands/execute.py @@ -670,7 +670,6 @@ class ReportScheduleStateMachine: # pylint: disable=too-few-public-methods self._scheduled_dttm = scheduled_dttm def run(self) -> None: - state_found = False for state_cls in self.states_cls: if (self._report_schedule.last_state is None and state_cls.initial) or ( self._report_schedule.last_state in state_cls.current_states @@ -681,9 +680,8 @@ class ReportScheduleStateMachine: # pylint: disable=too-few-public-methods self._scheduled_dttm, self._execution_id, ).next() - state_found = True break - if not state_found: + else: raise ReportScheduleStateNotFoundError()