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-01 10:08:57 +0100 |
commit | f803adf9f20a1be27824736d123d7ed54ba31ba7 (patch) | |
tree | cf0a4c8b8ee90684dd66b1775d559c3b7e24710a | |
parent | d12c1e0ae5fc9a4beca05d62166a41ef6e657203 (diff) |
Try to convert csv files of public bodies into utf-8 before importing them.0.12.0.2hotfix/0.12.0.2
-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 |