Fix error when uploading malformed CSV import (#19509)
parent
5fa340931e
commit
317ec06dc7
|
@ -26,6 +26,8 @@ class ImportValidator < ActiveModel::Validator
|
||||||
when 'following'
|
when 'following'
|
||||||
validate_following_import(import, row_count)
|
validate_following_import(import, row_count)
|
||||||
end
|
end
|
||||||
|
rescue CSV::MalformedCSVError
|
||||||
|
import.errors.add(:data, :malformed)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -29,6 +29,10 @@ en:
|
||||||
attributes:
|
attributes:
|
||||||
website:
|
website:
|
||||||
invalid: is not a valid URL
|
invalid: is not a valid URL
|
||||||
|
import:
|
||||||
|
attributes:
|
||||||
|
data:
|
||||||
|
malformed: is malformed
|
||||||
status:
|
status:
|
||||||
attributes:
|
attributes:
|
||||||
reblog:
|
reblog:
|
||||||
|
|
Loading…
Reference in New Issue