style: auto-format code with ruff (cron)

This commit is contained in:
AutoFix Bot
2026-03-02 18:13:08 +08:00
parent 98527c4de4
commit dc783c9d8e
22 changed files with 685 additions and 590 deletions

View File

@@ -688,7 +688,7 @@ class EnterpriseManager:
conn = self._get_connection()
try:
cursor = conn.cursor()
cursor.execute("SELECT * FROM sso_configs WHERE id = ?", (config_id, ))
cursor.execute("SELECT * FROM sso_configs WHERE id = ?", (config_id,))
row = cursor.fetchone()
if row:
@@ -722,7 +722,7 @@ class EnterpriseManager:
WHERE tenant_id = ? AND status = 'active'
ORDER BY created_at DESC LIMIT 1
""",
(tenant_id, ),
(tenant_id,),
)
row = cursor.fetchone()
@@ -802,7 +802,7 @@ class EnterpriseManager:
conn = self._get_connection()
try:
cursor = conn.cursor()
cursor.execute("DELETE FROM sso_configs WHERE id = ?", (config_id, ))
cursor.execute("DELETE FROM sso_configs WHERE id = ?", (config_id,))
conn.commit()
return cursor.rowcount > 0
finally:
@@ -818,7 +818,7 @@ class EnterpriseManager:
SELECT * FROM sso_configs WHERE tenant_id = ?
ORDER BY created_at DESC
""",
(tenant_id, ),
(tenant_id,),
)
rows = cursor.fetchall()
@@ -926,7 +926,7 @@ class EnterpriseManager:
"""
SELECT * FROM saml_auth_requests WHERE request_id = ?
""",
(request_id, ),
(request_id,),
)
row = cursor.fetchone()
@@ -1084,7 +1084,7 @@ class EnterpriseManager:
conn = self._get_connection()
try:
cursor = conn.cursor()
cursor.execute("SELECT * FROM scim_configs WHERE id = ?", (config_id, ))
cursor.execute("SELECT * FROM scim_configs WHERE id = ?", (config_id,))
row = cursor.fetchone()
if row:
@@ -1104,7 +1104,7 @@ class EnterpriseManager:
SELECT * FROM scim_configs WHERE tenant_id = ?
ORDER BY created_at DESC LIMIT 1
""",
(tenant_id, ),
(tenant_id,),
)
row = cursor.fetchone()
@@ -1398,7 +1398,7 @@ class EnterpriseManager:
UPDATE audit_log_exports SET status = 'processing'
WHERE id = ?
""",
(export_id, ),
(export_id,),
)
conn.commit()
@@ -1523,7 +1523,7 @@ class EnterpriseManager:
conn = self._get_connection()
try:
cursor = conn.cursor()
cursor.execute("SELECT * FROM audit_log_exports WHERE id = ?", (export_id, ))
cursor.execute("SELECT * FROM audit_log_exports WHERE id = ?", (export_id,))
row = cursor.fetchone()
if row:
@@ -1661,7 +1661,7 @@ class EnterpriseManager:
conn = self._get_connection()
try:
cursor = conn.cursor()
cursor.execute("SELECT * FROM data_retention_policies WHERE id = ?", (policy_id, ))
cursor.execute("SELECT * FROM data_retention_policies WHERE id = ?", (policy_id,))
row = cursor.fetchone()
if row:
@@ -1758,7 +1758,7 @@ class EnterpriseManager:
conn = self._get_connection()
try:
cursor = conn.cursor()
cursor.execute("DELETE FROM data_retention_policies WHERE id = ?", (policy_id, ))
cursor.execute("DELETE FROM data_retention_policies WHERE id = ?", (policy_id,))
conn.commit()
return cursor.rowcount > 0
finally:
@@ -1887,7 +1887,7 @@ class EnterpriseManager:
SELECT COUNT(*) as count FROM audit_logs
WHERE created_at < ?
""",
(cutoff_date, ),
(cutoff_date,),
)
count = cursor.fetchone()["count"]
@@ -1896,7 +1896,7 @@ class EnterpriseManager:
"""
DELETE FROM audit_logs WHERE created_at < ?
""",
(cutoff_date, ),
(cutoff_date,),
)
deleted = cursor.rowcount
return {"affected": count, "archived": 0, "deleted": deleted, "errors": 0}
@@ -1927,7 +1927,7 @@ class EnterpriseManager:
conn = self._get_connection()
try:
cursor = conn.cursor()
cursor.execute("SELECT * FROM data_retention_jobs WHERE id = ?", (job_id, ))
cursor.execute("SELECT * FROM data_retention_jobs WHERE id = ?", (job_id,))
row = cursor.fetchone()
if row: