Skip to content

Commit

Permalink
Saving is_emailed during actual email sending.
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelclay committed Jan 9, 2017
1 parent a7fcd82 commit 397b264
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 3 additions & 0 deletions apps/analyzer/models.py
Expand Up @@ -79,6 +79,9 @@ def send_email(self, limit=5000):
msg.attach(filename, xlsx.read(), 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')
msg.send()

self.is_emailed = True
self.save()

logging.debug(" -> ~BB~FM~SBSent email for popularity query: %s" % self)


Expand Down
3 changes: 0 additions & 3 deletions apps/analyzer/tasks.py
@@ -1,4 +1,3 @@
import datetime
from celery.task import Task
from utils import log as logging

Expand All @@ -11,6 +10,4 @@ def run(self, pk):
logging.debug(" -> ~BB~FCRunning popularity query: ~SB%s" % query)

query.send_email()
query.is_emailed = True
query.save()

0 comments on commit 397b264

Please sign in to comment.