mirror of
https://github.com/discourse/discourse.git
synced 2025-03-21 10:15:48 +08:00
FIX: Staged users should not be mentionable.
This commit is contained in:
parent
6111b285d9
commit
672e95bcb4
@ -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…
x
Reference in New Issue
Block a user