mirror of
https://github.com/wizarrrr/wizarr.git
synced 2026-06-11 15:24:58 -04:00
- Add Release Please GitHub Action workflow for automated releases - Configure conventional commits with commitizen for local enforcement - Update pyproject.toml version to current 2025.8.3 - Add release-please-config.json and manifest for version management - Fix Ruff linting issues (exception chaining and unnecessary assignment) - Update CLAUDE.md documentation with release automation workflow - Maintain compatibility with existing release.yml Docker builds 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
27 lines
837 B
Python
27 lines
837 B
Python
# app/middleware.py
|
|
from flask import current_app, redirect, request, url_for
|
|
|
|
from app.models import Settings
|
|
|
|
|
|
def require_onboarding():
|
|
if (
|
|
request.path.startswith("/setup")
|
|
or request.path.startswith("/static")
|
|
or request.path.startswith("/settings")
|
|
or request.path.startswith("/api")
|
|
):
|
|
return None
|
|
|
|
# Skip onboarding check during testing
|
|
if current_app.config.get("TESTING"):
|
|
return None
|
|
|
|
# Check if an admin user exists
|
|
admin_setting = Settings.query.filter_by(key="admin_username").first()
|
|
if not admin_setting or not admin_setting.value:
|
|
return redirect(url_for("setup.onboarding"))
|
|
return None
|
|
# Allow access to the application even if no MediaServer has been configured yet.
|
|
# Users can add servers later via the Settings page.
|