From 42412c4b3c86d4d36969b7f04aae324f0107e07e Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Sat, 8 Oct 2022 22:48:33 +0200 Subject: [PATCH] WIP: validation don --- controle_don/main.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/controle_don/main.py b/controle_don/main.py index 4af64df..334638a 100755 --- a/controle_don/main.py +++ b/controle_don/main.py @@ -160,10 +160,13 @@ def validate(record): os.system("cd {} && pdflatex {}".format(WORKDIR+"/validé/", filename+".tex")) # Preparing mail - mailheaders = get_file_content_all(RECEPT_MAIL_HEADERS).replace("COURRIEL-DON", - email) + "\n" - mailtext = get_file_content_all(RECEPT_MAIL) + "\n" - mailtattach = get_file_content_all(RECEPT_MAIL_ATTACHMENT) + "\n" + mailheaders = get_file_content_all(RECEPT_MAIL_HEADERS).replace( + "COURRIEL-DON", + email) + "\n" + mailtext = get_file_content_all(RECEPT_MAIL).replace("DATE-DON", date) + "\n" + mailtattach = get_file_content_all(RECEPT_MAIL_ATTACHMENT).replace( + "DATE-DON", + date.replace("/", ".")) + "\n" # Opening PDF file as binary attachment = open(WORKDIR+"/validé/"+filename+".pdf", "rb")