make path to message file absolute
This commit is contained in:
@@ -62,7 +62,13 @@ def check_user(user):
|
|||||||
|
|
||||||
def get_messagefile(user):
|
def get_messagefile(user):
|
||||||
"""Return message file of user, and create if necessary"""
|
"""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):
|
if not os.path.isfile(filepath):
|
||||||
Path(filepath).touch()
|
Path(filepath).touch()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user