FIX: view was getting rendered twice for rate limiting error

This commit is contained in:
Arpit Jalan 2017-12-12 14:48:58 +05:30
parent 98d19616dd
commit b014540fde
1 changed files with 1 additions and 1 deletions

View File

@ -75,7 +75,7 @@ class TopicsController < ApplicationController
begin begin
RateLimiter.new(current_user, "print-topic-per-hour", SiteSetting.max_prints_per_hour_per_user, 1.hour).performed! unless @guardian.is_admin? RateLimiter.new(current_user, "print-topic-per-hour", SiteSetting.max_prints_per_hour_per_user, 1.hour).performed! unless @guardian.is_admin?
rescue RateLimiter::LimitExceeded rescue RateLimiter::LimitExceeded
render_json_error(I18n.t("rate_limiter.slow_down")) return render_json_error I18n.t("rate_limiter.slow_down")
end end
end end