diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2011-06-26 19:23:04 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2011-06-26 19:23:04 -0400 |
commit | e2221760ba5bca8c0157da826198783e8fe244bc (patch) | |
tree | 6a31cdc93d9af1b9e2fa9e1b390c93667b1c6648 | |
parent | a2ca0f8234bbe231a57f75a9584054b87f777cdc (diff) | |
download | askbot-e2221760ba5bca8c0157da826198783e8fe244bc.tar.gz askbot-e2221760ba5bca8c0157da826198783e8fe244bc.tar.bz2 askbot-e2221760ba5bca8c0157da826198783e8fe244bc.zip |
incremented version and fixed a bug on comment edit
-rw-r--r-- | askbot/__init__.py | 2 | ||||
-rw-r--r-- | askbot/models/meta.py | 4 | ||||
-rw-r--r-- | askbot/tests/db_api_tests.py | 2 | ||||
-rw-r--r-- | askbot/views/writers.py | 2 |
4 files changed, 6 insertions, 4 deletions
diff --git a/askbot/__init__.py b/askbot/__init__.py index 9291023f..38d56af5 100644 --- a/askbot/__init__.py +++ b/askbot/__init__.py @@ -9,7 +9,7 @@ import smtplib import sys import logging -VERSION = (0, 7, 2) +VERSION = (0, 7, 3) #necessary for interoperability of django and coffin try: diff --git a/askbot/models/meta.py b/askbot/models/meta.py index 0db36ab3..7cccbcd6 100644 --- a/askbot/models/meta.py +++ b/askbot/models/meta.py @@ -301,9 +301,9 @@ class Comment(base.MetaContent, base.UserContent): what_to_count = { 'user': user, 'object_id': self.id, - 'content_type': self.content_type + 'content_type': content_type } - return Vote.objects.count(**what_to_count) > 0 + return Vote.objects.filter(**what_to_count).count() > 0 def is_last(self): """True if there are no newer comments on diff --git a/askbot/tests/db_api_tests.py b/askbot/tests/db_api_tests.py index 18fc174b..00091934 100644 --- a/askbot/tests/db_api_tests.py +++ b/askbot/tests/db_api_tests.py @@ -368,7 +368,7 @@ class CommentTests(AskbotTestCase): comments = self.question.get_comments(visitor = self.other_user) self.assertEquals(len(comments), 1) self.assertEquals(comments[0].upvoted_by_user, True) - + self.assertEquals(comments[0].is_upvoted_by(self.other_user), True) def test_other_user_can_cancel_upvote(self): self.test_other_user_can_upvote_comment() diff --git a/askbot/views/writers.py b/askbot/views/writers.py index c5a69c1d..bb49c971 100644 --- a/askbot/views/writers.py +++ b/askbot/views/writers.py @@ -586,6 +586,8 @@ def post_comments(request):#generic ajax handler to load comments to an object @decorators.ajax_only def edit_comment(request): + import pdb + pdb.set_trace() if request.user.is_authenticated(): comment_id = int(request.POST['comment_id']) comment = models.Comment.objects.get(id = comment_id) |