NewsBlur/apps/analyzer/tasks.py
2017-01-05 18:26:50 -08:00

16 lines
439 B
Python

import datetime
from celery.task import Task
from utils import log as logging
class EmailPopularityQuery(Task):
def run(self, pk):
from apps.analyzer.models import MPopularityQuery
query = MPopularityQuery.objects.get(pk=pk)
logging.user(self.user, "~BB~FCRunning popularity query: ~SB%s" % query)
query.send_email()
query.is_emailed = True
query.save()