Skip to content

Commit 1cf47c8

Browse files
committed
MAIL_ADMIN in users.config is not exist, use current_app.config instead
1 parent b0a90f6 commit 1cf47c8

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

users/views.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"""
66
import json
77

8-
from flask import render_template, Response, request
8+
from flask import render_template, Response, request, current_app
99
from werkzeug.exceptions import default_exceptions
1010

1111
# App declared directly in __init__ as per
@@ -25,8 +25,6 @@
2525
get_all_users,
2626
)
2727

28-
from users.config import MAIL_ADMIN
29-
3028

3129
@APP.route('/')
3230
def map_view():
@@ -163,7 +161,7 @@ def add_user_view():
163161
user=added_user)
164162
recipient = added_user.email
165163
send_async_mail(
166-
sender=MAIL_ADMIN,
164+
sender=current_app.config["MAIL_ADMIN"],
167165
recipients=[recipient],
168166
subject=subject,
169167
text_body=body,
@@ -374,7 +372,7 @@ def reminder_view():
374372
url=APP.config["PUBLIC_URL"],
375373
user=user)
376374
send_async_mail(
377-
sender=MAIL_ADMIN,
375+
sender=current_app.config["MAIL_ADMIN"],
378376
recipients=[email],
379377
subject=subject,
380378
text_body=body, html_body='')

0 commit comments

Comments
 (0)