diff --git a/app/database/database.py b/app/database/database.py index 12986022..4ab0ae75 100644 --- a/app/database/database.py +++ b/app/database/database.py @@ -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"'. diff --git a/app/database/migrations.py b/app/database/migrations.py index 26d6b384..5520eea4 100644 --- a/app/database/migrations.py +++ b/app/database/migrations.py @@ -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) diff --git a/app/services/web_api_token_service.py b/app/services/web_api_token_service.py index 4f43dc69..e8b1b30a 100644 --- a/app/services/web_api_token_service.py +++ b/app/services/web_api_token_service.py @@ -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