Auto-commit local changes before build (2026-03-20 15:01:28)

This commit is contained in:
Ivo Oskamp 2026-03-20 15:01:28 +01:00
parent c5a6759112
commit 5fdf0f130b
2 changed files with 22 additions and 0 deletions

View File

@ -200,6 +200,21 @@ def create_app():
return None return None
@app.context_processor
def inject_inbox_count():
"""Inject inbox_count into every template so the sidebar badge is always visible."""
try:
from flask_login import current_user as _cu
if not _cu or not _cu.is_authenticated:
return {}
from .models import MailMessage
q = MailMessage.query
if hasattr(MailMessage, "location"):
q = q.filter(MailMessage.location == "inbox")
return {"inbox_count": int(q.count() or 0)}
except Exception:
return {}
@app.get("/health") @app.get("/health")
def health(): def health():
return {"status": "ok"} return {"status": "ok"}

View File

@ -2,6 +2,13 @@
This file documents all changes made to this project via Claude Code. This file documents all changes made to this project via Claude Code.
## [2026-03-20] (7)
### Fixed
- Inbox badge in sidebar now visible on all pages (not only the dashboard):
- Added a Flask `context_processor` in `__init__.py` that injects `inbox_count` into every template for authenticated users
- Previously `inbox_count` was only passed in the dashboard route, causing the badge to disappear on all other pages
## [2026-03-20] (6) ## [2026-03-20] (6)
### Fixed ### Fixed