Skip to content

Commit 8c7a7c1

Browse files
ClearlyClairehiyuki2578
authored andcommitted
Fix suspended account's fields being set as empty dict instead of list (mastodon#10178)
Fixes mastodon#10177
1 parent 1a3d004 commit 8c7a7c1

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

app/models/account.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ def fields
242242
def fields_attributes=(attributes)
243243
fields = []
244244
old_fields = self[:fields] || []
245+
old_fields = [] if old_fields.is_a?(Hash)
245246

246247
if attributes.is_a?(Hash)
247248
attributes.each_value do |attr|

app/services/suspend_account_service.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def purge_profile!
8484
@account.locked = false
8585
@account.display_name = ''
8686
@account.note = ''
87-
@account.fields = {}
87+
@account.fields = []
8888
@account.statuses_count = 0
8989
@account.followers_count = 0
9090
@account.following_count = 0

0 commit comments

Comments
 (0)