Skip to content

Commit

Permalink
[#1635] Fix repeat email sending
Browse files Browse the repository at this point in the history
The `since` date wasn't being saved after sending an email to a user,
resulting in repeat emails being sent about the same activity.

There is a test for this, but for some reason it was working in the
tests, just not in production. Don't know why. This seems to fix it in
production.
  • Loading branch information
Sean Hammond committed Dec 4, 2012
1 parent b29c28f commit ce7041f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ckan/lib/email_notifications.py
Expand Up @@ -134,7 +134,9 @@ def get_and_send_notifications_for_user(user):
# FIXME: We are accessing model from lib here but I'm not sure what
# else to do unless we add a update_email_last_sent()
# logic function which would only be needed by this lib.
model.Dashboard.get(user['id']).email_last_sent = datetime.datetime.now()
dash = model.Dashboard.get(user['id'])
dash.email_last_sent = datetime.datetime.now()
model.repo.commit()


def get_and_send_notifications_for_all_users():
Expand Down

0 comments on commit ce7041f

Please sign in to comment.