Fixed anonymizer when 'full name required' setting is on

When the setting 'full name required' is on the anonymizer was trying to set the user name to nil and this caused the user name and email to remain not anonymized.
Now in this scenario the user name is set to the anonimized username and the email is anonymized correctly.
This commit is contained in:
jeremylan 2016-03-17 17:43:21 +11:00
parent a8dbba9a01
commit d95728dd16
1 changed files with 1 additions and 1 deletions

View File

@ -20,7 +20,7 @@ class UserAnonymizer
@user.reload
@user.password = SecureRandom.hex
@user.email = "#{@user.username}@example.com"
@user.name = nil
@user.name = SiteSetting.full_name_required ? @user.username : nil
@user.date_of_birth = nil
@user.title = nil
@user.uploaded_avatar_id = nil