diff options
author | ThibG <thib@sitedethib.com> | 2019-03-05 15:19:54 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2019-03-05 18:05:54 +0100 |
commit | ae9e5ac6c8116001c13d4d49d3e3bdc64e98aa1b (patch) | |
tree | 50db38b6fa862c824c6aee59c59403b703f98083 | |
parent | 7034bb65d65718f3864287e40a67887109889c2b (diff) |
Fix suspended account's fields being set as empty dict instead of list (#10178)
Fixes #10177
-rw-r--r-- | app/models/account.rb | 1 | ||||
-rw-r--r-- | app/services/suspend_account_service.rb | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/app/models/account.rb b/app/models/account.rb index 11a3c21fe48..930fd1674e6 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -240,6 +240,7 @@ class Account < ApplicationRecord def fields_attributes=(attributes) fields = [] old_fields = self[:fields] || [] + old_fields = [] if old_fields.is_a?(Hash) if attributes.is_a?(Hash) attributes.each_value do |attr| diff --git a/app/services/suspend_account_service.rb b/app/services/suspend_account_service.rb index fc3bc03a532..b2ae3a47c16 100644 --- a/app/services/suspend_account_service.rb +++ b/app/services/suspend_account_service.rb @@ -84,7 +84,7 @@ class SuspendAccountService < BaseService @account.locked = false @account.display_name = '' @account.note = '' - @account.fields = {} + @account.fields = [] @account.statuses_count = 0 @account.followers_count = 0 @account.following_count = 0 |