From e8b49eb250c5b713a4c80e4ce403d5fdf77d9b0d Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Tue, 7 Aug 2018 00:31:47 +0200 Subject: async is now a reserved word --- src/notifications/emails.py | 4 ++-- src/web/decorators.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/notifications/emails.py b/src/notifications/emails.py index 3ee0aa4a..e2c9f444 100644 --- a/src/notifications/emails.py +++ b/src/notifications/emails.py @@ -28,12 +28,12 @@ import sendgrid from sendgrid.helpers.mail import * import conf -from web.decorators import async +from web.decorators import async_maker logger = logging.getLogger(__name__) -@async +@async_maker def send_async_email(mfrom, mto, msg): try: s = smtplib.SMTP(conf.NOTIFICATION_HOST) diff --git a/src/web/decorators.py b/src/web/decorators.py index 83a06a48..3835f646 100644 --- a/src/web/decorators.py +++ b/src/web/decorators.py @@ -7,7 +7,7 @@ from functools import wraps from flask_login import login_required -def async(f): +def async_maker(f): """ This decorator enables to launch a task (for examle sending an email or indexing the database) in background. -- cgit