Compare commits
No commits in common. "9f6430505058925457e252ecc805501890d7be70" and "c7675c231fbacfb7c4e308d01d4a5878ce7b2e38" have entirely different histories.
9f64305050
...
c7675c231f
@ -35,7 +35,7 @@ class _Accounts(pydantic.BaseModel):
|
||||
def _accounts_list_to_json(accounts: Iterable[DecryptedAccount]) -> str:
|
||||
result = _Accounts(
|
||||
accounts=[_Account.from_usual_account(i) for i in accounts],
|
||||
).json(ensure_ascii=False, indent=2)
|
||||
).json(ensure_ascii=False)
|
||||
return result
|
||||
|
||||
|
||||
|
@ -540,6 +540,7 @@ async def _export2(
|
||||
)
|
||||
tasks.append(loop.run_in_executor(pool, function))
|
||||
accounts = await asyncio.gather(*tasks)
|
||||
accounts.sort(key=lambda account: account.name)
|
||||
json_io = accounts_to_json(accounts)
|
||||
await bot.send_document(
|
||||
mes.chat.id,
|
||||
|
@ -36,12 +36,8 @@ def get_account_names(
|
||||
|
||||
def get_accounts(engine: Engine, user_id: int) -> list[models.Account]:
|
||||
"""Returns a list of accounts of a user"""
|
||||
statement = (
|
||||
sqlmodel.select(models.Account)
|
||||
.where(
|
||||
models.Account.user_id == user_id,
|
||||
)
|
||||
.order_by(models.Account.name)
|
||||
statement = sqlmodel.select(models.Account).where(
|
||||
models.Account.user_id == user_id,
|
||||
)
|
||||
with sqlmodel.Session(engine) as session:
|
||||
result = session.exec(statement).fetchall()
|
||||
|
@ -4,11 +4,7 @@ import sqlmodel
|
||||
class MasterPass(sqlmodel.SQLModel, table=True):
|
||||
__tablename__ = "master_passwords"
|
||||
user_id: int = sqlmodel.Field(
|
||||
sa_column=sqlmodel.Column(
|
||||
sqlmodel.INT(),
|
||||
primary_key=True,
|
||||
autoincrement=False,
|
||||
)
|
||||
sa_column=sqlmodel.Column(sqlmodel.INT(), primary_key=True)
|
||||
)
|
||||
salt: bytes = sqlmodel.Field(
|
||||
sa_column=sqlmodel.Column(sqlmodel.BINARY(64), nullable=False)
|
||||
|
Reference in New Issue
Block a user