FIX: Make autotag watched words case insensitive (#13043)

* FIX: Hide tag watched words if tagging is disabled

These 'autotag' words were shown even if tagging was disabled.

* FIX: Make autotag watched words case insensitive

This commit also fixes the bug when no tag was applied if no other tag
was already present.
This commit is contained in:
Bianca Nenciu
2021-05-14 16:52:10 +03:00
committed by GitHub
parent 0e6a8757fe
commit 3a1b05f219
5 changed files with 26 additions and 27 deletions

View File

@@ -6,7 +6,9 @@ class Admin::WatchedWordsController < Admin::AdminController
skip_before_action :check_xhr, only: [:download]
def index
render_json_dump WatchedWordListSerializer.new(WatchedWord.by_action, scope: guardian, root: false)
watched_words = WatchedWord.by_action
watched_words = watched_words.where.not(action: WatchedWord.actions[:tag]) if !SiteSetting.tagging_enabled
render_json_dump WatchedWordListSerializer.new(watched_words, scope: guardian, root: false)
end
def create