From 380cdd5563683965807a240e39a81c43cd4c1e9a Mon Sep 17 00:00:00 2001 From: Sikati Kenmogne Samuel Date: Sat, 9 Nov 2024 14:52:44 +0100 Subject: [PATCH] fix: resolve error reading from password.env file in apps/pages/results/results.py - Fixed the issue where the application was unable to read from the `password.env` file. - Updated the file reading logic in `apps/pages/results/results.py` to handle file paths correctly. --- apps/pages/results/result.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/pages/results/result.py b/apps/pages/results/result.py index 1e14bc8a..ad0ea700 100644 --- a/apps/pages/results/result.py +++ b/apps/pages/results/result.py @@ -26,7 +26,11 @@ for key, value in dotenv_values().items(): ENV_CONFIG[key] = value -with open(os.getcwd() + "\\apps\\pages\\results\\password.env") as f: +# Construct the file path using os.path.join for cross-platform compatibility +file_path = os.path.join(os.getcwd(), "apps", "pages", "results", "password.env") + +# Open the file and read the password +with open(file_path, 'r') as f: password = f.read().split('=')[1] dash.register_page(__name__, path_template='/result/') @@ -758,4 +762,4 @@ def add_to_elements(clade, clade_id): 'backgroundColor': "#00faad" } } -] \ No newline at end of file +]