comparison core/tasks.py @ 893:3aecf9058130

Merge with upstream.
author Brian Neal <bgneal@gmail.com>
date Tue, 17 Feb 2015 18:59:06 -0600
parents 79a71b9d0a2a
children
comparison
equal deleted inserted replaced
889:ae146e30d588 893:3aecf9058130
2 Celery tasks for the core application. 2 Celery tasks for the core application.
3 3
4 """ 4 """
5 from __future__ import absolute_import 5 from __future__ import absolute_import
6 6
7 import django.core.mail
7 from celery import shared_task 8 from celery import shared_task
8 import django.core.mail
9 9
10 import core.whos_online 10 import core.whos_online
11 11
12 12
13 @shared_task 13 @shared_task
14 def send_mail(subject, message, from_email, recipient_list, **kwargs): 14 def send_mail(**kwargs):
15 """ 15 """
16 A task to send mail via Django. 16 A task to send mail via Django.
17 17
18 kwargs must be a dict of keyword arguments for an EmailMessage.
19
18 """ 20 """
19 django.core.mail.send_mail(subject, message, from_email, recipient_list, 21 msg = django.core.mail.EmailMessage(**kwargs)
20 **kwargs) 22 msg.send()
21 23
22 24
23 @shared_task 25 @shared_task
24 def cleanup(): 26 def cleanup():
25 """ 27 """