diff --git a/src/forest/app.py b/src/forest/app.py index f23cf14..3aad6aa 100644 --- a/src/forest/app.py +++ b/src/forest/app.py @@ -16,11 +16,11 @@ from flask import ( from waitress import serve from flask_sqlalchemy import SQLAlchemy from flask_bootstrap import Bootstrap -from flask_mail import Mail from flask_wtf.csrf import CSRFProtect, CSRFError from flask_moment import Moment from models import db, lm +from mailsender import mail sys.stderr.write("worker uid={} gid={}".format(os.getuid(), os.getgid())) sys.stderr.flush() @@ -31,7 +31,6 @@ app.config.from_object("config.Config") db.init_app(app) lm.init_app(app) -mail = Mail() mail.init_app(app) bootstrap = Bootstrap() diff --git a/src/forest/mailsender.py b/src/forest/mailsender.py index 733346f..26ae430 100644 --- a/src/forest/mailsender.py +++ b/src/forest/mailsender.py @@ -1,8 +1,10 @@ from threading import Thread from flask import current_app, render_template -from flask_mail import Message +from flask_mail import Mail, Message from decorators import asyncfn +mail = Mail() + @asyncfn def send_async_email(app, msg): with app.app_context(): diff --git a/src/forest/templates/nav.html b/src/forest/templates/nav.html index be901cd..7778cd4 100644 --- a/src/forest/templates/nav.html +++ b/src/forest/templates/nav.html @@ -40,7 +40,6 @@
  • Dashboard
  • Profile
  • -
  • Logout