mirror of
https://github.com/discourse/discourse.git
synced 2025-08-21 19:11:18 +08:00
FIX: Staged users should not be mentionable.
This commit is contained in:
parent
6111b285d9
commit
672e95bcb4
2 changed files with 9 additions and 1 deletions
|
@ -460,7 +460,7 @@ module PrettyText
|
|||
:user_type AS type,
|
||||
username_lower AS name
|
||||
FROM users
|
||||
WHERE username_lower IN (:names)
|
||||
WHERE username_lower IN (:names) AND staged = false
|
||||
)
|
||||
UNION
|
||||
(
|
||||
|
|
|
@ -241,6 +241,14 @@ describe PrettyText do
|
|||
end
|
||||
end
|
||||
|
||||
it 'does not mention staged users' do
|
||||
user = Fabricate(:user, staged: true)
|
||||
|
||||
expect(PrettyText.cook("something @#{user.username} something")).to eq(
|
||||
%Q|<p>something <span class="mention">@#{user.username}</span> something</p>|
|
||||
)
|
||||
end
|
||||
|
||||
describe 'when mentions are disabled' do
|
||||
before do
|
||||
SiteSetting.enable_mentions = false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue