style: apply ruff formatting

This commit is contained in:
Fringg
2026-02-18 08:11:33 +03:00
parent 784616b349
commit 764e063bfe
3 changed files with 3 additions and 8 deletions
+1 -3
View File
@@ -471,9 +471,7 @@ async def sync_postgres_sequences() -> bool:
q_schema = _quote_ident(table_schema)
q_table = _quote_ident(table_name)
max_result = await conn.execute(
text(f'SELECT COALESCE(MAX({q_col}), 0) FROM {q_schema}.{q_table}')
)
max_result = await conn.execute(text(f'SELECT COALESCE(MAX({q_col}), 0) FROM {q_schema}.{q_table}'))
max_value = max_result.scalar() or 0
# pg_get_serial_sequence returns e.g. '"public"."users_id_seq"'.
+1 -2
View File
@@ -44,8 +44,7 @@ async def run_alembic_upgrade() -> None:
if await _needs_auto_stamp():
logger.warning(
'Обнаружена существующая БД без alembic_version — '
'автоматический stamp 0001 (переход с universal_migration)'
'Обнаружена существующая БД без alembic_version — автоматический stamp 0001 (переход с universal_migration)'
)
await _stamp_alembic_revision(_INITIAL_REVISION)
+1 -3
View File
@@ -95,9 +95,7 @@ class WebApiTokenService:
"""Hash without HMAC (for legacy fallback)."""
return hash_api_token(token, self.algorithm) # type: ignore[arg-type]
async def _load_token_with_fallback(
self, db: AsyncSession, value: str
) -> WebApiToken | None:
async def _load_token_with_fallback(self, db: AsyncSession, value: str) -> WebApiToken | None:
"""Load token by hash, falling back to plain hash if HMAC is enabled.
When HMAC is newly enabled, existing tokens are stored with plain