Made class Account private in utils.py

This commit is contained in:
StNicolay 2022-11-14 16:40:16 +03:00
parent 3802943225
commit cc13b35282

View File

@ -11,7 +11,7 @@ from sqlalchemy.future import Engine
from .. import cryptography, database
class Account(pydantic.BaseModel):
class _Account(pydantic.BaseModel):
name: str
login: str
passwd: str
@ -25,11 +25,11 @@ class Account(pydantic.BaseModel):
class _Accounts(pydantic.BaseModel):
accounts: list[Account] = pydantic.Field(default_factory=list)
accounts: list[_Account] = pydantic.Field(default_factory=list)
def _accounts_list_to_json(accounts: list[tuple[str, str, str]]) -> str:
accounts = _Accounts(accounts=[Account.from_tuple(i) for i in accounts])
accounts = _Accounts(accounts=[_Account.from_tuple(i) for i in accounts])
return accounts.json()