Skip to content
Browse files

Ensure comments get queued for processing even if rendering fails.

This is a hacky fix for comments failing to render causing incorrect
comment counts.
  • Loading branch information...
1 parent 86265bf commit fd61e80f5b16f28e161c2edf36761492f93f5145 @spladug spladug committed with kemitche Feb 25, 2014
Showing with 11 additions and 11 deletions.
  1. +11 −11 r2/r2/controllers/api.py
View
22 r2/r2/controllers/api.py
@@ -1454,6 +1454,17 @@ def POST_comment(self, commentform, jquery, parent, comment, ip):
# newcomments_q, so if they refresh immediately they
# won't see their comment
+ #update the queries
+ if is_message:
+ queries.new_message(item, inbox_rel)
+ else:
+ queries.new_comment(item, inbox_rel)
+
+ #set the ratelimiter
+ if should_ratelimit:
+ VRatelimit.ratelimit(rate_user=True, rate_ip = True,
+ prefix = "rate_comment_")
+
# clean up the submission form and remove it from the DOM (if reply)
t = commentform.find("textarea")
t.attr('rows', 3).html("").val("")
@@ -1468,17 +1479,6 @@ def POST_comment(self, commentform, jquery, parent, comment, ip):
# remove any null listings that may be present
jquery("#noresults").hide()
- #update the queries
- if is_message:
- queries.new_message(item, inbox_rel)
- else:
- queries.new_comment(item, inbox_rel)
-
- #set the ratelimiter
- if should_ratelimit:
- VRatelimit.ratelimit(rate_user=True, rate_ip = True,
- prefix = "rate_comment_")
-
@validatedForm(VUser(),
VModhash(),
VCaptcha(),

0 comments on commit fd61e80

Please sign in to comment.
Something went wrong with that request. Please try again.