Files
wizarr/app/middleware.py
Matthieu B d19500f510 feat: add Release Please automation with Conventional Commits
- 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>
2025-08-31 14:39:41 +02:00

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.