style: apply ruff formatting
This commit is contained in:
@@ -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"'.
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user