Auto-commit local changes before build (2026-03-20 15:01:28)
This commit is contained in:
parent
c5a6759112
commit
5fdf0f130b
@ -200,6 +200,21 @@ def create_app():
|
||||
|
||||
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")
|
||||
def health():
|
||||
return {"status": "ok"}
|
||||
|
||||
@ -2,6 +2,13 @@
|
||||
|
||||
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)
|
||||
|
||||
### Fixed
|
||||
|
||||
Loading…
Reference in New Issue
Block a user