move Mail object to mailsender

This commit is contained in:
deflax 2024-04-03 19:19:37 +03:00
parent 9b4d98e3d9
commit 413500c53f
3 changed files with 4 additions and 4 deletions

View file

@ -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()

View file

@ -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():

View file

@ -40,7 +40,6 @@
<li><a href="{{ url_for('panel.dashboard') }}"><span class="glyphicon glyphicon-modal-window"></span> Dashboard</a></li>
<li role="separator" class="divider"></li>
<li><a href="{{ url_for('settings.profile') }}"><span class="glyphicon glyphicon-user"></span> Profile</a></li>
<!-- <li><a href="{{ url_for('panel.support_list') }}"><span class="glyphicon glyphicon-question-sign"></span> Support</a></li>-->
<li><a href="{{ url_for('auth.logout') }}"><span class="glyphicon glyphicon-off"></span> Logout</a></li>
</ul>
</li>