mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-27 10:30:15 -05:00
Ensure case-insensitive fields are converted to lowercase in user imports (#29740)
This commit is contained in:
parent
a3e8b78250
commit
eb926b7e60
@ -111,12 +111,14 @@ class Form::Import
|
||||
csv_converter = lambda do |field, field_info|
|
||||
case field_info.header
|
||||
when 'Show boosts', 'Notify on new posts', 'Hide notifications'
|
||||
ActiveModel::Type::Boolean.new.cast(field)
|
||||
ActiveModel::Type::Boolean.new.cast(field&.downcase)
|
||||
when 'Languages'
|
||||
field&.split(',')&.map(&:strip)&.presence
|
||||
when 'Account address'
|
||||
field.strip.gsub(/\A@/, '')
|
||||
when '#domain', '#uri', 'List name'
|
||||
when '#domain'
|
||||
field&.strip&.downcase
|
||||
when '#uri', 'List name'
|
||||
field.strip
|
||||
else
|
||||
field
|
||||
|
Loading…
Reference in New Issue
Block a user