Skip to content

Commit e4ad804

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

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
@@ -241,6 +241,7 @@ def fields
241241
def fields_attributes=(attributes)
242242
fields = []
243243
old_fields = self[:fields] || []
244+
old_fields = [] if old_fields.is_a?(Hash)
244245

245246
if attributes.is_a?(Hash)
246247
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)