summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdolfo Fitoria <adolfo.fitoria@gmail.com>2012-10-02 19:14:57 -0600
committerAdolfo Fitoria <adolfo.fitoria@gmail.com>2012-10-02 19:14:57 -0600
commitbce103ac7af62b299b5770a2574658d19ac18790 (patch)
tree0b34fc8f4204984285c1ddeee6729ee12b646d97
parent2a398269923b779b63ca8432b6d98dc2ae6c6a50 (diff)
downloadaskbot-bce103ac7af62b299b5770a2574658d19ac18790.tar.gz
askbot-bce103ac7af62b299b5770a2574658d19ac18790.tar.bz2
askbot-bce103ac7af62b299b5770a2574658d19ac18790.zip
fixing some tests and merge errors, commit before the lights goes out
-rw-r--r--askbot/auth.py10
-rw-r--r--askbot/const/__init__.py8
-rw-r--r--askbot/search/haystack/__init__.py2
-rw-r--r--askbot/tests/badge_tests.py2
-rw-r--r--askbot/tests/haystack_search_tests.py2
-rw-r--r--askbot/views/users.py2
6 files changed, 13 insertions, 13 deletions
diff --git a/askbot/auth.py b/askbot/auth.py
index c80f5db1..846445b4 100644
--- a/askbot/auth.py
+++ b/askbot/auth.py
@@ -238,7 +238,7 @@ def onAnswerAcceptCanceled(answer, user, timestamp=None):
reputation.save()
if answer.author == question.author and user == question.author:
- #a symmettric measure for the reputation gaming plug
+ #a symmettric measure for the reputation gaming plug
#as in the onAnswerAccept function
#here it protects the user from uwanted reputation loss
return
@@ -263,7 +263,7 @@ def onUpVoted(vote, post, user, timestamp=None):
if post.post_type != 'comment':
post.vote_up_count = int(post.vote_up_count) + 1
- post.score = int(post.score) + 1
+ post.points = int(post.points) + 1
post.save()
if post.post_type == 'comment':
@@ -300,7 +300,7 @@ def onUpVotedCanceled(vote, post, user, timestamp=None):
if post.vote_up_count < 0:
post.vote_up_count = 0
- post.score = int(post.score) - 1
+ post.points = int(post.points) - 1
post.save()
if post.post_type == 'comment':
@@ -333,7 +333,7 @@ def onDownVoted(vote, post, user, timestamp=None):
vote.save()
post.vote_down_count = int(post.vote_down_count) + 1
- post.score = int(post.score) - 1
+ post.points = int(post.points) - 1
post.save()
if not (post.wiki or post.is_anonymous):
@@ -375,7 +375,7 @@ def onDownVotedCanceled(vote, post, user, timestamp=None):
post.vote_down_count = int(post.vote_down_count) - 1
if post.vote_down_count < 0:
post.vote_down_count = 0
- post.score = post.score + 1
+ post.points = post.points + 1
post.save()
if not (post.wiki or post.is_anonymous):
diff --git a/askbot/const/__init__.py b/askbot/const/__init__.py
index 5f47bb79..977cf0c5 100644
--- a/askbot/const/__init__.py
+++ b/askbot/const/__init__.py
@@ -299,7 +299,7 @@ POST_STATUS = {
'deleted': _('[deleted]'),
'default_version': _('initial version'),
'retagged': _('retagged'),
- 'private': _('[private]')
+ 'private': _('[private]')
}
#choices used in email and display filters
@@ -361,7 +361,7 @@ DEFAULT_USER_STATUS = 'w'
#number of items to show in user views
USER_VIEW_DATA_SIZE = 50
-#not really dependency, but external links, which it would
+#not really dependency, but external links, which it would
#be nice to test for correctness from time to time
DEPENDENCY_URLS = {
'akismet': 'https://akismet.com/signup/',
@@ -411,8 +411,8 @@ SEARCH_ORDER_BY = (
('last_activity_at', _('activity ascendant')),
('-answer_count', _('answers descendant')),
('answer_count', _('answers ascendant')),
- ('-score', _('votes descendant')),
- ('score', _('votes ascendant')),
+ ('-points', _('votes descendant')),
+ ('points', _('votes ascendant')),
)
DEFAULT_QUESTION_WIDGET_STYLE = """
diff --git a/askbot/search/haystack/__init__.py b/askbot/search/haystack/__init__.py
index 71f04d00..e6576d4a 100644
--- a/askbot/search/haystack/__init__.py
+++ b/askbot/search/haystack/__init__.py
@@ -53,7 +53,7 @@ try:
#FIXME: add a highlight here?
id_list.append(r.pk)
- return model_klass.objects.filter(id__in=set(id_list))
+ return model_klass.objects.filter(id__in=set(id_list)).distinct()
except:
pass
diff --git a/askbot/tests/badge_tests.py b/askbot/tests/badge_tests.py
index 8e4458f6..c184db6f 100644
--- a/askbot/tests/badge_tests.py
+++ b/askbot/tests/badge_tests.py
@@ -70,7 +70,7 @@ class BadgeTests(AskbotTestCase):
#post another question and check that there are no new badges
question2 = self.post_question(user = self.u1)
answer2 = self.post_answer(user = self.u2, question = question2)
- answer2.score = min_score - 1
+ answer2.score = min_points - 1
answer2.save()
self.u1.upvote(answer2)
diff --git a/askbot/tests/haystack_search_tests.py b/askbot/tests/haystack_search_tests.py
index d5935ff6..82e73cc0 100644
--- a/askbot/tests/haystack_search_tests.py
+++ b/askbot/tests/haystack_search_tests.py
@@ -53,8 +53,8 @@ class HaystackSearchTests(AskbotTestCase):
def test_title_search(self):
#title search
title_search_qs = models.Thread.objects.get_for_query('title')
- self.assertEquals(title_search_qs.count(), 2)
title_search_qs_2 = models.Thread.objects.get_for_query('Nome')
+ self.assertEquals(title_search_qs.count(), 2)
self.assertEquals(title_search_qs_2.count(), 1)
@skipIf('haystack' not in settings.INSTALLED_APPS,
diff --git a/askbot/views/users.py b/askbot/views/users.py
index ee3c7d91..c2f11328 100644
--- a/askbot/views/users.py
+++ b/askbot/views/users.py
@@ -391,7 +391,7 @@ def user_stats(request, user, context):
).select_related(
'thread'
).order_by(
- '-score', '-added_at'
+ '-points', '-added_at'
)[:100]
top_answer_count = len(top_answers)