From 557ea2075e6977c3cbe1528ce14240ff8ec57418 Mon Sep 17 00:00:00 2001 From: vitor Date: Tue, 5 Sep 2023 11:10:06 -0300 Subject: [PATCH] fix css file access --- src/notification/email_sender.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/notification/email_sender.py b/src/notification/email_sender.py index a830e71..e34fa51 100644 --- a/src/notification/email_sender.py +++ b/src/notification/email_sender.py @@ -57,7 +57,11 @@ def generate_email_content(self) -> str: """Generate HTML content to be sent by email based on search_report dictionary """ - with open('../report_style.css', 'r') as f: + current_directory = os.path.dirname(__file__) + parent_directory = os.path.dirname(current_directory) + file_path = os.path.join(parent_directory, 'report_style.css') + + with open(file_path, 'r') as f: blocks = [f''] for group, results in self.search_report.items():