Skip to content

Commit d9d2fc8

Browse files
committed
fix using state and remove unused function transition_to
1 parent c30abfc commit d9d2fc8

1 file changed

Lines changed: 1 addition & 11 deletions

File tree

scripts/automated_ingestion/eessi_task.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,7 +1268,7 @@ def _perform_task_add(self) -> bool:
12681268
stderr=subprocess.PIPE)
12691269
# TODO: if ingest_cmd.returncode == 0:
12701270
if True:
1271-
next_state = self._next_state(self.state)
1271+
next_state = self._next_state(TaskState.APPROVED)
12721272
self._update_task_state_file(next_state)
12731273
if self.config.has_section('slack') and self.config['slack'].getboolean('ingestion_notification', False):
12741274
send_slack_message(
@@ -1333,16 +1333,6 @@ def _handle_add_rejected(self):
13331333
# (INGESTED/REJECTED) would be overwritten
13341334
return TaskState.DONE
13351335

1336-
@log_function_entry_exit()
1337-
def transition_to(self, new_state: TaskState):
1338-
"""
1339-
Transition the task to a new state if valid.
1340-
"""
1341-
if new_state in self.valid_transitions[self.state]:
1342-
self.state = new_state
1343-
return True
1344-
return False
1345-
13461336
@log_function_entry_exit()
13471337
def __str__(self):
13481338
return f"EESSITask(description={self.description}, action={self.action}, state={self.determine_state()})"

0 commit comments

Comments
 (0)