summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPatricio Cano <suprnova32@gmail.com>2016-08-01 12:14:03 -0500
committerPatricio Cano <suprnova32@gmail.com>2016-08-15 13:18:15 -0500
commitabf2dcd25c4a176801314872733ede91297d1ab0 (patch)
tree581aceab4c6a341bb6532145a1907ed4b9a25760 /lib
parent64ab2b3d9f10366249c03a6bcf5e8b1d20010d8f (diff)
downloadgitlab-ce-abf2dcd25c4a176801314872733ede91297d1ab0.tar.gz
Allow `SpamLog` to be submitted as ham
- Added `submitted_as_ham` to `SpamLog` to mark which logs have been submitted to Akismet. - Added routes and controller action.
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/akismet_helper.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/gitlab/akismet_helper.rb b/lib/gitlab/akismet_helper.rb
index b74d8176cc7..bd71a1aaa51 100644
--- a/lib/gitlab/akismet_helper.rb
+++ b/lib/gitlab/akismet_helper.rb
@@ -52,8 +52,10 @@ module Gitlab
begin
client.submit_ham(ip_address, user_agent, params)
+ true
rescue => e
Rails.logger.error("Unable to connect to Akismet: #{e}, skipping!")
+ false
end
end
@@ -69,8 +71,10 @@ module Gitlab
begin
client.submit_spam(details.ip_address, details.user_agent, params)
+ true
rescue => e
Rails.logger.error("Unable to connect to Akismet: #{e}, skipping!")
+ false
end
end
end