From ae4ff49924ee7e1eed409e9f1a2797958bd17a6f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 13:33:49 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- studio/backend/auth/storage.py | 6 ++---- studio/backend/models/auth.py | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/studio/backend/auth/storage.py b/studio/backend/auth/storage.py index 9456f7fea5..0c4a995c5b 100644 --- a/studio/backend/auth/storage.py +++ b/studio/backend/auth/storage.py @@ -393,7 +393,7 @@ def create_api_key( """ raw_key = API_KEY_PREFIX + secrets.token_hex(16) key_hash = _hash_token(raw_key) - key_prefix = raw_key[len(API_KEY_PREFIX): len(API_KEY_PREFIX) + 8] + key_prefix = raw_key[len(API_KEY_PREFIX) : len(API_KEY_PREFIX) + 8] now = datetime.now(timezone.utc).isoformat() conn = get_connection() @@ -406,9 +406,7 @@ def create_api_key( (username, key_prefix, key_hash, name, now, expires_at), ) conn.commit() - cur = conn.execute( - "SELECT * FROM api_keys WHERE key_hash = ?", (key_hash,) - ) + cur = conn.execute("SELECT * FROM api_keys WHERE key_hash = ?", (key_hash,)) row = cur.fetchone() return raw_key, dict(row) finally: diff --git a/studio/backend/models/auth.py b/studio/backend/models/auth.py index d6d63b3485..c55e646508 100644 --- a/studio/backend/models/auth.py +++ b/studio/backend/models/auth.py @@ -68,7 +68,9 @@ class ApiKeyResponse(BaseModel): id: int name: str - key_prefix: str = Field(..., description = "First 8 characters after sk-unsloth- for display") + key_prefix: str = Field( + ..., description = "First 8 characters after sk-unsloth- for display" + ) created_at: str last_used_at: Optional[str] = None expires_at: Optional[str] = None