Files
wizarr/app/context_processors.py
Matthieu B d91f4dc431 chore(deps): bulk-bump python and npm deps from open dependabot PRs (#1279)
* chore(deps): bulk-bump python and npm deps from open dependabot PRs

Consolidates the 15 currently-open dependabot PRs into a single change so
the maintenance churn lands in one merge instead of fifteen.

Python (uv.lock):
- idna 3.11 -> 3.15 (#1267)
- urllib3 2.6.3 -> 2.7.0 (#1264)
- flask-wtf 1.2.2 -> 1.3.0, sqlalchemy 2.0.48 -> 2.0.50, wtforms 3.2.1 -> 3.2.2 (#1258)
- pyright 1.1.408 -> 1.1.409, pre-commit 4.5.1 -> 4.6.0, ruff 0.15.8 -> 0.15.14 (#1250)
- wlc 1.17.2 -> 2.0.0 (#1248)
- pytest 9.0.2 -> 9.0.3 (#1239)
- cryptography 46.0.6 -> 46.0.7 (#1235)
- cachetools 7.0.1 -> 7.0.5 (#1233)
- plexapi 4.18.0 -> 4.18.1 (#1232)
- requests 2.33.0 -> 2.33.1 (#1231)

npm (app/static):
- flowbite 4.0.1 -> 4.0.2, @tailwindcss/cli 4.2.2 -> 4.3.0, tailwindcss 4.2.2 -> 4.3.0 (#1265)
- tiny-markdown-editor 0.2.25 -> 0.2.27 (#1263)
- @alpinejs/collapse 3.15.9 -> 3.15.12 (#1256)
- alpinejs 3.15.10 -> 3.15.12 (#1255)
- htmx.org 2.0.8 -> 2.0.10 (#1245)

Verified: full pytest suite passes (504 passed, 1 skipped); ty diagnostic
count unchanged vs baseline.

* style: ruff auto-fix import order (I001)

Pre-existing import-sort issues surfaced by the lint CI job on this PR
(main pushes don't run the lint job so they went uncaught).
2026-05-30 14:02:23 +02:00

40 lines
1.2 KiB
Python

import os
from app.extensions import db
from app.models import Settings
def inject_server_name():
from sqlalchemy.exc import OperationalError, PendingRollbackError
try:
# Use no_autoflush to prevent triggering pending session changes
with db.session.no_autoflush:
setting = Settings.query.filter_by(key="server_name").first()
server_name = setting.value if setting else "Wizarr"
except (OperationalError, PendingRollbackError) as e:
if "database is locked" in str(e).lower():
# Fallback to default if database is locked
server_name = "Wizarr"
else:
raise
return {"server_name": server_name}
def inject_plus_features():
"""Inject Plus features availability into template context."""
try:
import plus
is_plus_enabled = plus.is_plus_enabled() # type: ignore
except (ImportError, AttributeError):
is_plus_enabled = False
return {"is_plus_enabled": is_plus_enabled}
def inject_app_version():
"""Inject current app version into template context for cache busting."""
return {"app_version": os.getenv("APP_VERSION", "dev")}