make path to message file absolute

This commit is contained in:
2021-12-23 14:48:51 +01:00
parent 671af52b15
commit 57de8f47d0

View File

@@ -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()