From 57de8f47d05c1a805d28dca2da60356e6c65b41a Mon Sep 17 00:00:00 2001 From: "max.mehl" Date: Thu, 23 Dec 2021 14:48:51 +0100 Subject: [PATCH] make path to message file absolute --- autoreply_editor/main.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/autoreply_editor/main.py b/autoreply_editor/main.py index 9ca639a..baeec3c 100644 --- a/autoreply_editor/main.py +++ b/autoreply_editor/main.py @@ -62,7 +62,13 @@ def check_user(user): def get_messagefile(user): """Return message file of user, and create if necessary""" - filepath = f"message-{user}.txt" + # Path of the project + gitpath = str(Path(app.root_path).parent) + # File name of the message + filename = f"message-{user}.txt" + # Combine path + filepath = os.path.join(gitpath, filename) + if not os.path.isfile(filepath): Path(filepath).touch()