From a994b822a4231061153c6b27d8c5d7307b59f8b0 Mon Sep 17 00:00:00 2001 From: Botond Hende Date: Sun, 1 Sep 2024 23:33:15 +0200 Subject: ship task setting from request body --- apirouters/agents.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'apirouters/agents.py') diff --git a/apirouters/agents.py b/apirouters/agents.py index a1e015b..1b927e7 100644 --- a/apirouters/agents.py +++ b/apirouters/agents.py @@ -5,7 +5,7 @@ import openapi_client from fastapi import APIRouter, Depends, Response, HTTPException from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm -from ..modules import task_type +from ..modules import task_types from ..modules.database import cursor, conn from ..modules.ships import Ship @@ -87,7 +87,7 @@ def load_agents_from_database() -> None: ship.load_task() except: for ship in agent.ships.values(): - ship.set_task(tasks.ERROR) + ship.set_task(task_types.ERROR) cursor.execute("SELECT symbol FROM ships WHERE symbol LIKE ?", (f"{agent.agent_symbol}-%",)) ship_names = agent.ships.keys() @@ -96,7 +96,7 @@ def load_agents_from_database() -> None: continue missing_ship = Ship(row[0]) - missing_ship.set_task(tasks.MIA) + missing_ship.set_task(task_types.MIA) agent.ships[row[0]] = missing_ship -- cgit v1.2.3-70-g09d2