From a3fdebc8f9a0d88a9ae2789fda1e92337229f151 Mon Sep 17 00:00:00 2001
From: luap42 <21335202+luap42@users.noreply.github.com>
Date: Fri, 31 Jul 2020 22:24:26 +0200
Subject: [PATCH] Better voting limit messages

---
 app/controllers/votes_controller.rb | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/app/controllers/votes_controller.rb b/app/controllers/votes_controller.rb
index f523c69b0..f26a0c8d2 100644
--- a/app/controllers/votes_controller.rb
+++ b/app/controllers/votes_controller.rb
@@ -14,7 +14,13 @@ class VotesController < ApplicationController
     max_votes_per_day = SiteSetting['FreeVotes'] + (@current_user.reputation - SiteSetting['NewUserInitialRep'])
 
     if recent_votes >= max_votes_per_day
-      vote_limit_msg = 'You have used your daily vote limit: ' + recent_votes.to_s + '/' + max_votes_per_day.to_s
+      vote_limit_msg = 'You have used your daily vote limit of ' + recent_votes.to_s + 'votes. Gain more reputation or' \
+                       ' come back tomorrow to continue voting.'
+
+      if max_votes_per_day <= 0
+        vote_limit_msg = 'You need to gain some reputation on this site before you can start voting.'
+      end
+
       render json: { status: 'failed', message: vote_limit_msg }, status: 403
       return
     end
-- 
GitLab