mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 15:25:35 +08:00
FIX: Anonymizing a user clears their user status too (#21673)
This commit is contained in:
parent
95358062fc
commit
07061410d8
|
@ -60,6 +60,8 @@ class UserAnonymizer
|
|||
)
|
||||
end
|
||||
|
||||
@user.clear_status!
|
||||
|
||||
@user.user_avatar&.destroy!
|
||||
@user.single_sign_on_record&.destroy!
|
||||
@user.oauth2_user_infos.destroy_all
|
||||
|
|
|
@ -107,6 +107,15 @@ RSpec.describe UserAnonymizer do
|
|||
end
|
||||
end
|
||||
|
||||
it "clears existing user status" do
|
||||
user_status = Fabricate(:user_status, user: user)
|
||||
|
||||
expect do
|
||||
make_anonymous
|
||||
user.reload
|
||||
end.to change { user.user_status }.from(user_status).to(nil)
|
||||
end
|
||||
|
||||
context "when Site Settings require full name" do
|
||||
before { SiteSetting.full_name_required = true }
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user