summaryrefslogtreecommitdiffstats
path: root/hyperkitty/lib/__init__.py
diff options
context:
space:
mode:
authorAurélien Bompard <aurelien@bompard.org>2013-02-13 18:13:46 +0100
committerAurélien Bompard <aurelien@bompard.org>2013-02-13 18:30:04 +0100
commit02d09d5304823de3439bc0eb701cddbdb66c0d42 (patch)
tree4ee675714d4d2babbef65e4621f278f7a725f3dc /hyperkitty/lib/__init__.py
parent0e96a34e0d54b06c79750afafc503a3444bcddfd (diff)
downloadhyperkitty-02d09d5304823de3439bc0eb701cddbdb66c0d42.tar.gz
hyperkitty-02d09d5304823de3439bc0eb701cddbdb66c0d42.tar.xz
hyperkitty-02d09d5304823de3439bc0eb701cddbdb66c0d42.zip
Allow cancelling a vote
Diffstat (limited to 'hyperkitty/lib/__init__.py')
-rw-r--r--hyperkitty/lib/__init__.py16
1 files changed, 0 insertions, 16 deletions
diff --git a/hyperkitty/lib/__init__.py b/hyperkitty/lib/__init__.py
index b3fa6c4..895e64e 100644
--- a/hyperkitty/lib/__init__.py
+++ b/hyperkitty/lib/__init__.py
@@ -25,7 +25,6 @@ import datetime
from django.conf import settings
-from hyperkitty.models import Rating
def gravatar_url(email):
@@ -88,18 +87,3 @@ def get_display_dates(year, month, day):
end_date = begin_date + datetime.timedelta(days=1)
return begin_date, end_date
-
-
-def get_votes(message_id_hash):
- """Extract all the votes for this message"""
- likes = dislikes = 0
- try:
- votes = Rating.objects.filter(messageid=message_id_hash)
- except Rating.DoesNotExist:
- votes = {}
- for vote in votes:
- if vote.vote == 1:
- likes += 1
- elif vote.vote == -1:
- dislikes += 1
- return likes, dislikes