From 04760170c25873fcb844879d4a11cec7a0b01d67 Mon Sep 17 00:00:00 2001 From: Dries Peeters Date: Fri, 31 Oct 2025 10:51:33 +0100 Subject: [PATCH] fix: pass datetime module to test email template Fixes warning 'datetime is undefined' that appeared when sending test emails. The test_email.html template was trying to use datetime.utcnow() to display the timestamp, but the datetime module wasn't included in the template context. This change ensures the HTML email template renders correctly with the formatted timestamp. --- app/utils/email.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/utils/email.py b/app/utils/email.py index 1f85c703..60273538 100644 --- a/app/utils/email.py +++ b/app/utils/email.py @@ -432,7 +432,8 @@ TimeTracker - Time Tracking & Project Management mail_server=current_app.config.get('MAIL_SERVER'), mail_port=current_app.config.get('MAIL_PORT'), use_tls=current_app.config.get('MAIL_USE_TLS'), - use_ssl=current_app.config.get('MAIL_USE_SSL') + use_ssl=current_app.config.get('MAIL_USE_SSL'), + datetime=datetime ) current_app.logger.info("[EMAIL TEST] HTML template rendered successfully") except Exception as template_error: