diff --git a/tools/utils.py b/tools/utils.py index ff524e9..c90d585 100644 --- a/tools/utils.py +++ b/tools/utils.py @@ -27,10 +27,12 @@ def login_required(f): def append_to_log(log_line, user): + tmp="" log_file=os.path.join(DOSSIER_PERSO, user, "log.txt") - logs=open(log_file, "r") - tmp=logs.read() - logs.close() + if os.path.exists(log_file): + logs=open(log_file, "r") + tmp=logs.read() + logs.close() log=open(log_file, "w") log.write(log_line) log.write(tmp)