Edit depends call in i18n
This commit is contained in:
parent
9f0ab4ae5a
commit
a13636ca49
8 changed files with 52 additions and 53 deletions
|
|
@ -44,7 +44,7 @@ class ContainerPositionManager:
|
|||
},
|
||||
}
|
||||
|
||||
def get_position_and_state(self, container_name: str, translations: Translations = Depends(get_translations())) -> Tuple[int, int, bool]:
|
||||
def get_position_and_state(self, container_name: str, translations: Translations = None) -> Tuple[int, int, bool]:
|
||||
"""Получает текущие координаты и состояние указанного контейнера.
|
||||
|
||||
Args:
|
||||
|
|
@ -57,6 +57,7 @@ class ContainerPositionManager:
|
|||
Raises:
|
||||
ValueError: Если указан неверный идентификатор контейнера.
|
||||
"""
|
||||
translations = translations or get_translations()()
|
||||
container = self.positions.get(container_name)
|
||||
if not container:
|
||||
raise ValueError(translations.gettext("Неверное имя контейнера: {container_name}").format(container_name=container_name))
|
||||
|
|
@ -222,4 +223,4 @@ async def get_hostname(translations: Translations = Depends(get_translations()))
|
|||
return hostname_info
|
||||
except Exception as e:
|
||||
logger.error(f"Error in get_hostname: {e}")
|
||||
raise HTTPException(status_code=500, detail=translations.gettext("Не удалось получить имя хоста"))
|
||||
raise HTTPException(status_code=500, detail=translations.gettext("Не удалось получить имя хоста"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue