Fix error when uploading malformed CSV import (#19509)

lolsob-rspec
Eugen Rochko 2022-10-28 23:30:44 +02:00 committed by GitHub
parent 528f96e769
commit 92a6d04ba6
2 changed files with 6 additions and 0 deletions

View File

@ -26,6 +26,8 @@ class ImportValidator < ActiveModel::Validator
when 'following'
validate_following_import(import, row_count)
end
rescue CSV::MalformedCSVError
import.errors.add(:data, :malformed)
end
private

View File

@ -29,6 +29,10 @@ en:
attributes:
website:
invalid: is not a valid URL
import:
attributes:
data:
malformed: is malformed
status:
attributes:
reblog: