Fix error when uploading malformed CSV import (#19509)

This commit is contained in:
Eugen Rochko authored and GitHub committed 2022-10-28 23:30:44 +02:00
1 parent 5fa340931e
commit 317ec06dc7
2 files changed
+6

No files matched your search

+2
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
+4
View File
@@ -29,6 +29,10 @@ en:
attributes:
website:
invalid: is not a valid URL
import:
attributes:
data:
malformed: is malformed
status:
attributes:
reblog: