Skip to content

Commit

Permalink
Fix suspended account's fields being set as empty dict instead of list (
Browse files Browse the repository at this point in the history
#10178)

Fixes #10177
  • Loading branch information
ClearlyClaire authored and Gargron committed Mar 5, 2019
1 parent ac99b34 commit d785497
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/models/account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ def fields
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|
Expand Down
2 changes: 1 addition & 1 deletion app/services/suspend_account_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def purge_profile!
@account.locked = false
@account.display_name = ''
@account.note = ''
@account.fields = {}
@account.fields = []
@account.statuses_count = 0
@account.followers_count = 0
@account.following_count = 0
Expand Down

0 comments on commit d785497

Please sign in to comment.