From 3496cc7bebc642fee587820b8aabc2910097f961 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Tue, 14 Sep 2021 12:21:22 +0200 Subject: [PATCH] fix envoi mail etud change --- app/scodoc/sco_etud.py | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/app/scodoc/sco_etud.py b/app/scodoc/sco_etud.py index 80981b37..46ef0aca 100644 --- a/app/scodoc/sco_etud.py +++ b/app/scodoc/sco_etud.py @@ -31,27 +31,21 @@ # Ancien module "scolars" import os import time - -from flask import url_for, g, request - -from email.mime.multipart import MIMEMultipart -from email.mime.text import MIMEText -from email.header import Header -from email.mime.base import MIMEBase from operator import itemgetter +from flask import url_for, g, request +from flask_mail import Message + +from app import email +from app import log + import app.scodoc.sco_utils as scu -from app.scodoc.sco_utils import SCO_ENCODING import app.scodoc.notesdb as ndb from app.scodoc.sco_exceptions import ScoGenError, ScoValueError - -from app import log -from app.scodoc.TrivialFormulator import TrivialFormulator from app.scodoc import safehtml from app.scodoc import sco_preferences from app.scodoc.scolog import logdb -from flask_mail import Message -from app import mail +from app.scodoc.TrivialFormulator import TrivialFormulator MONTH_NAMES_ABBREV = [ "Jan ", @@ -456,7 +450,7 @@ def notify_etud_change(email_addr, etud, before, after, subject): log("notify_etud_change: sending notification to %s" % email_addr) log("notify_etud_change: subject: %s" % subject) log(txt) - mail.send_email( + email.send_email( subject, sco_preferences.get_preference("email_from_addr"), [email_addr], txt ) return txt