diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2011-10-06 17:27:41 -0300 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2011-10-06 17:27:41 -0300 |
commit | bcdc986552c66639606ed5e7e9956822b5136801 (patch) | |
tree | e83d82c370b4dfe1b629c07101c3d7578c72a704 /askbot/tasks.py | |
parent | 115e4b6316c7821f03abf14211551ea0269ea2aa (diff) | |
download | askbot-bcdc986552c66639606ed5e7e9956822b5136801.tar.gz askbot-bcdc986552c66639606ed5e7e9956822b5136801.tar.bz2 askbot-bcdc986552c66639606ed5e7e9956822b5136801.zip |
moved mention savings to the celery job and now many test cases for email alerts fail
Diffstat (limited to 'askbot/tasks.py')
-rw-r--r-- | askbot/tasks.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/askbot/tasks.py b/askbot/tasks.py index b0ac5356..0a238df1 100644 --- a/askbot/tasks.py +++ b/askbot/tasks.py @@ -100,7 +100,21 @@ def record_post_update( exclude_list = [updated_by, ] ) - update_activity.add_recipients(recipients) + #create new mentions + for u in newly_mentioned_users: + from askbot.models.user import Activity + Activity.objects.create_new_mention( + mentioned_whom = u, + mentioned_in = post, + mentioned_by = updated_by, + mentioned_at = timestamp + ) + + #we don't want to save a mention and a separate notification + #about the response + update_activity.add_recipients( + recipients# - set(newly_mentioned_users) + ) assert(updated_by not in recipients) |