summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2019-01-17 11:39:28 +0000
committerSean McGivern <sean@gitlab.com>2019-01-18 12:46:05 +0000
commitd00b4a2eb11dbc90dc0cee781d55e14b68efe265 (patch)
treeee3b8b0e8dc75c9ac7f46201c3388d1db6ea8acb /app
parenta0991cdcc15cdeabafbdf20c820d2fa58125c5e6 (diff)
downloadgitlab-ce-d00b4a2eb11dbc90dc0cee781d55e14b68efe265.tar.gz
Don't check confidential issues for spam
Spam checks are meant for content that could be indexed by search engines. Confidential issues aren't indexed by search engines, so we don't need to do spam checks for them. We do need to check for spam when an issue changes from confidential to public, even if nothing else changed.
Diffstat (limited to 'app')
-rw-r--r--app/models/issue.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index b7e13bcbccf..5c4ecbfdf4e 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -230,7 +230,8 @@ class Issue < ActiveRecord::Base
end
def check_for_spam?
- project.public? && (title_changed? || description_changed?)
+ publicly_visible? &&
+ (title_changed? || description_changed? || confidential_changed?)
end
def as_json(options = {})