Skip to content

A platform for community discussion. Free, open, simple.

FIX: Don't delete profile views during user anonymization

Gerhard Schlagera26889ada287
diff --git a/app/services/user_anonymizer.rb b/app/services/user_anonymizer.rb
index 35e77ea88d0..9e9d8667e34 100644
--- a/app/services/user_anonymizer.rb
+++ b/app/services/user_anonymizer.rb
@@ -47,9 +47,10 @@ class UserAnonymizer
options.email_direct = false
options.save
- profile = @user.user_profile
- profile.destroy if profile
- @user.create_user_profile
+ if profile = @user.user_profile
+ profile.update(location: nil, website: nil, bio_raw: nil, bio_cooked: nil,
+ profile_background: nil, card_background: nil)
+ end
@user.user_avatar.try(:destroy)
@user.twitter_user_info.try(:destroy)