Refactor user authentication and dashboard features
- Added `is_admin` field to User model for role management. - Updated user context middleware to include current user in templates. - Enhanced session management with improved debug middleware. - Refactored dashboard view to fetch user-specific data and recent events. - Improved login and registration templates for better user experience. - Added admin routes with access control for admin users. - Updated Docker configuration for better error logging and dependency management. - Updated requirements to include new dependencies and specify versions.
This commit is contained in:
@@ -20,3 +20,4 @@ templates = MyJinjaTemplates(directory=str(BASE_DIR / "templates"))
|
||||
|
||||
# Register a context processor to add current_user to all templates
|
||||
templates.env.globals["get_current_user"] = lambda: None # Will be overridden at runtime
|
||||
templates.env.globals["current_user"] = None
|
||||
|
||||
Reference in New Issue
Block a user