style: apply ruff auto-fix

- Auto-formatted code with ruff format
- Applied ruff linting fixes with --fix

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2026-02-23 09:33:48 +00:00
parent 7fe25474bb
commit 540541eec6
13 changed files with 193 additions and 550 deletions
+9 -12
View File
@@ -12,12 +12,13 @@ from fastapi.responses import RedirectResponse
from sqlalchemy.orm import Session
from app.utils.config_validator.masking import mask_sensitive_value
from app.utils.settings_service import (SETTING_METADATA,
get_all_settings_from_db,
get_setting_metadata,
get_settings_by_category)
from app.views.base import (APIRouter, get_db, require_login, settings,
templates)
from app.utils.settings_service import (
SETTING_METADATA,
get_all_settings_from_db,
get_setting_metadata,
get_settings_by_category,
)
from app.views.base import APIRouter, get_db, require_login, settings, templates
logger = logging.getLogger(__name__)
router = APIRouter()
@@ -102,9 +103,7 @@ async def settings_page(request: Request, db: Session = Depends(get_db)):
settings_data[category].append(
{
"key": key,
"display_value": (
display_value if display_value is not None else ""
),
"display_value": (display_value if display_value is not None else ""),
"metadata": metadata,
"source": source,
"source_label": source_label,
@@ -175,9 +174,7 @@ async def credentials_page(request: Request, db: Session = Depends(get_db)):
)
total = sum(len(v) for v in categories.values())
configured_count = sum(
1 for creds in categories.values() for c in creds if c["configured"]
)
configured_count = sum(1 for creds in categories.values() for c in creds if c["configured"])
return templates.TemplateResponse(
"credentials.html",
+5 -17
View File
@@ -40,11 +40,7 @@ async def setup_wizard(request: Request, step: int = 1, db: Session = Depends(ge
current_settings = wizard_steps.get(step, [])
# Get step category (all settings in a step should have same category)
step_category = (
current_settings[0].get("wizard_category", "Configuration")
if current_settings
else "Configuration"
)
step_category = current_settings[0].get("wizard_category", "Configuration") if current_settings else "Configuration"
# Enrich settings with current live values
from app.config import settings as app_settings
@@ -68,9 +64,7 @@ async def setup_wizard(request: Request, step: int = 1, db: Session = Depends(ge
else:
current_value = ""
value_source = "none"
enriched_settings.append(
{**s, "current_value": current_value, "value_source": value_source}
)
enriched_settings.append({**s, "current_value": current_value, "value_source": value_source})
current_settings = enriched_settings
return templates.TemplateResponse(
@@ -88,9 +82,7 @@ async def setup_wizard(request: Request, step: int = 1, db: Session = Depends(ge
@router.post("/setup")
async def setup_wizard_save(
request: Request, step: int = Form(...), db: Session = Depends(get_db)
):
async def setup_wizard_save(request: Request, step: int = Form(...), db: Session = Depends(get_db)):
"""
Save settings from the current wizard step.
"""
@@ -138,9 +130,7 @@ async def setup_wizard_save(
except Exception as e:
logger.error(f"Error saving wizard settings: {e}")
return RedirectResponse(
url=f"/setup?step={step}&error=save_failed", status_code=303
)
return RedirectResponse(url=f"/setup?step={step}&error=save_failed", status_code=303)
@router.get("/setup/skip")
@@ -176,9 +166,7 @@ async def setup_wizard_undo_skip(request: Request, db: Session = Depends(get_db)
try:
from app.utils.settings_service import delete_setting_from_db
delete_setting_from_db(
db, "_setup_wizard_skipped", changed_by="wizard_undo_skip"
)
delete_setting_from_db(db, "_setup_wizard_skipped", changed_by="wizard_undo_skip")
logger.info("Setup wizard skip marker removed; redirecting to wizard")
return RedirectResponse(url="/setup?step=1", status_code=303)
except Exception as e: