diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-08-01 10:08:57 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-08-14 09:46:34 +0100 |
commit | b2ce0da712088976a7396fcb5e6e37be26819103 (patch) | |
tree | 998b2d30543eb3a77c853d60a383c6a0e87a35dd | |
parent | 73f9bb4ed1dea48a5f2e45b714368079a11c2e0e (diff) |
Try to convert csv files of public bodies into utf-8 before importing them.
-rw-r--r-- | app/controllers/admin_public_body_controller.rb | 2 | ||||
-rw-r--r-- | spec/fixtures/files/fake-authority-type.csv | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/admin_public_body_controller.rb b/app/controllers/admin_public_body_controller.rb index 078af12f4..ec2a08dbc 100644 --- a/app/controllers/admin_public_body_controller.rb +++ b/app/controllers/admin_public_body_controller.rb @@ -146,12 +146,12 @@ class AdminPublicBodyController < AdminController if params[:csv_file] csv_contents = params[:csv_file].read @original_csv_file = params[:csv_file].original_filename + csv_contents = normalize_string_to_utf8(csv_contents) # or from previous dry-run temporary file elsif params[:temporary_csv_file] && params[:original_csv_file] csv_contents = retrieve_csv_data(params[:temporary_csv_file]) @original_csv_file = params[:original_csv_file] end - if !csv_contents.nil? # Try with dry run first errors, notes = PublicBody.import_csv(csv_contents, diff --git a/spec/fixtures/files/fake-authority-type.csv b/spec/fixtures/files/fake-authority-type.csv index 4aa618ad1..cb25050c6 100644 --- a/spec/fixtures/files/fake-authority-type.csv +++ b/spec/fixtures/files/fake-authority-type.csv @@ -1,3 +1,4 @@ ,North West Fake Authority,north_west_foi@localhost ,Scottish Fake Authority,scottish_foi@localhost ,Fake Authority of Northern Ireland,ni_foi@localhost +,Gobierno de Aragón,spain_foi@localhost |