diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-05-27 02:38:22 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-05-27 02:38:22 -0400 |
commit | 6ca7dd00282cf76edf80e2c003a2876a78981fdb (patch) | |
tree | 2458d103011dbd2fa2fbcab21f06660e29209e81 /askbot/tasks.py | |
parent | a3369a5eda129db32009961d75d1624756a4ec29 (diff) | |
download | askbot-6ca7dd00282cf76edf80e2c003a2876a78981fdb.tar.gz askbot-6ca7dd00282cf76edf80e2c003a2876a78981fdb.tar.bz2 askbot-6ca7dd00282cf76edf80e2c003a2876a78981fdb.zip |
test cases for the post approval notifications pass
Diffstat (limited to 'askbot/tasks.py')
-rw-r--r-- | askbot/tasks.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/askbot/tasks.py b/askbot/tasks.py index 23966119..447b6b78 100644 --- a/askbot/tasks.py +++ b/askbot/tasks.py @@ -25,6 +25,7 @@ from celery.decorators import task from askbot.conf import settings as askbot_settings from askbot.models import Activity, Post, Thread, User from askbot.models import send_instant_notifications_about_activity_in_post +from askbot.models import notify_author_about_approved_post from askbot.models.badges import award_badges_signal # TODO: Make exceptions raised inside record_post_update_celery_task() ... @@ -32,6 +33,10 @@ from askbot.models.badges import award_badges_signal # (i.e. if Celery tasks are not deferred but executed straight away) @task(ignore_result = True) +def notify_author_about_approved_post_celery_task(post): + notify_author_about_approved_post(post) + +@task(ignore_result = True) def record_post_update_celery_task( post_id, post_content_type_id, @@ -156,10 +161,7 @@ def record_post_update( post = post, recipients = notification_subscribers, ) - #if post.post_type in ('question', 'answer'): - # if created and post.was_moderated(): - # notify_author_about_approved_post(post) - + @task(ignore_result = True) def record_question_visit( |