]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/views/commands.py
fixes a nasty bug causing a view to never return a response under certain circumstances
[osqa.git] / forum / views / commands.py
index fcdd0561a79b2410fd4da7b42e5cd4129e9bb654..af6ad644e8ee6466dad347890b9995e15722a214 100644 (file)
@@ -73,7 +73,7 @@ def vote_post(request, id, vote_type):
 
     user_vote_count_today = user.get_vote_count_today()
 
-    if user_vote_count_today >= int(settings.MAX_VOTES_PER_DAY):
+    if user_vote_count_today >= user.can_vote_count_today():
         raise NotEnoughLeftException(_('votes'), str(settings.MAX_VOTES_PER_DAY))
 
     new_vote_cls = (vote_type == 'up') and VoteUpAction or VoteDownAction
@@ -284,7 +284,7 @@ def node_markdown(request, id):
         raise AnonymousNotAllowedException(_('accept answers'))
 
     node = get_object_or_404(Node, id=id)
-    return HttpResponse(node.body, mimetype="text/plain")
+    return HttpResponse(node.active_revision.body, mimetype="text/plain")
 
 
 @decorate.withfn(command)