]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/views/commands.py
Removing a bunch of incorrect, useless and/or obselete files that the repository...
[osqa.git] / forum / views / commands.py
index e2942bde8d36e03e8dbe8d5fc1424866dea7c378..ee62af4c6859f2acb5ffd8171bbe29e8d2ded383 100644 (file)
@@ -43,7 +43,7 @@ class AnonymousNotAllowedException(Exception):
 
 class NotEnoughLeftException(Exception):
     def __init__(self, action, limit):
-        super(NotEnoughRepPointsException, self).__init__(
+        super(NotEnoughLeftException, self).__init__(
             _("""
             Sorry, but you don't have enough %(action)s left for today..<br />
             The limit is %(limit)s per day..<br />
@@ -63,7 +63,7 @@ class CannotDoubleActionException(Exception):
 
 @command
 def vote_post(request, id, vote_type):
-    post = get_object_or_404(Node, id=id)
+    post = get_object_or_404(Node, id=id).leaf
     vote_score = vote_type == 'up' and 1 or -1
     user = request.user
 
@@ -107,7 +107,7 @@ def vote_post(request, id, vote_type):
     votes_left = int(settings.MAX_VOTES_PER_DAY) - user_vote_count_today + (vote_type == 'none' and -1 or 1)
 
     if int(settings.START_WARN_VOTES_LEFT) >= votes_left:
-        response['message'] = _("You have %(nvotes) %(tvotes) left today.") % \
+        response['message'] = _("You have %(nvotes)s %(tvotes)s left today.") % \
                     {'nvotes': votes_left, 'tvotes': ungettext('vote', 'votes', votes_left)}
 
     return response