diff options
-rw-r--r-- | MANIFEST.in | 2 | ||||
-rw-r--r-- | askbot/models/base.py | 10 | ||||
-rw-r--r-- | askbot/skins/default/media/style/style.css | 1 | ||||
-rw-r--r-- | askbot/tasks.py | 18 | ||||
-rw-r--r-- | askbot/tests/on_screen_notification_tests.py | 2 |
5 files changed, 18 insertions, 15 deletions
diff --git a/MANIFEST.in b/MANIFEST.in index 7d503fb7..c6e22075 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -11,6 +11,7 @@ recursive-exclude .git prune dist prune tmp prune build +exclude db exclude lint exclude settings.py exclude manage.py @@ -26,4 +27,3 @@ recursive-exclude categories * recursive-exclude follow * recursive-exclude env * recursive-exclude .tox -exclude db diff --git a/askbot/models/base.py b/askbot/models/base.py index 80572b86..b456bca8 100644 --- a/askbot/models/base.py +++ b/askbot/models/base.py @@ -134,16 +134,6 @@ def parse_and_save_post(post, author = None, **kwargs): timestamp = post.get_time_of_last_edit() - #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 = author, - mentioned_at = timestamp - ) - #todo: this is handled in signal because models for posts #are too spread out from askbot.models import signals diff --git a/askbot/skins/default/media/style/style.css b/askbot/skins/default/media/style/style.css index 6297721b..600cd31e 100644 --- a/askbot/skins/default/media/style/style.css +++ b/askbot/skins/default/media/style/style.css @@ -473,7 +473,6 @@ ul#related-tags li { float: left; height: 18px; margin: 0 5px 0 0; - overflow-x: hidden; padding: 0; } diff --git a/askbot/tasks.py b/askbot/tasks.py index b0ac5356..465465ef 100644 --- a/askbot/tasks.py +++ b/askbot/tasks.py @@ -41,7 +41,6 @@ def record_post_update_celery_task( id__in = newly_mentioned_user_id_list ) - record_post_update( post = post, updated_by = updated_by, @@ -71,7 +70,6 @@ def record_post_update( * records "red envelope" recipients of the post * sends email alerts to all subscribers to the post """ - #todo: take into account created == True case (activity_type, update_object) = post.get_updated_activity_data(created) @@ -99,9 +97,23 @@ def record_post_update( recipients = post.get_response_receivers( exclude_list = [updated_by, ] ) - update_activity.add_recipients(recipients) + #create new mentions + for u in newly_mentioned_users: + #todo: a hack - some users will not have record of a mention + #may need to fix this in the future. Added this so that + #recipients of the response who are mentioned as well would + #not get two notifications in the inbox for the same post + if u in recipients: + continue + Activity.objects.create_new_mention( + mentioned_whom = u, + mentioned_in = post, + mentioned_by = updated_by, + mentioned_at = timestamp + ) + assert(updated_by not in recipients) for user in (set(recipients) | set(newly_mentioned_users)): diff --git a/askbot/tests/on_screen_notification_tests.py b/askbot/tests/on_screen_notification_tests.py index 574f4e5e..0d668542 100644 --- a/askbot/tests/on_screen_notification_tests.py +++ b/askbot/tests/on_screen_notification_tests.py @@ -244,6 +244,8 @@ class OnScreenUpdateNotificationTests(TestCase): ) def test_self_comments(self): + """poster of the question or answer adds a comment + under the corresponding question or answer""" self.reset_response_counts() time.sleep(1) timestamp = datetime.datetime.now() |