aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/admin_public_body_controller.rb
diff options
context:
space:
mode:
authorDavid Cabo <david@calibea.com>2011-08-09 18:52:15 +0200
committerSeb Bacon <seb.bacon@gmail.com>2011-08-11 15:01:24 +0100
commit4713ad8cfde9b37befdf8c9cac3f26da0997786a (patch)
treef2d0fa0c98725951fd36efec50d47e6b54a9aed9 /app/controllers/admin_public_body_controller.rb
parentb4af048ec41048c1dd05a6b5445d5e357ba4444a (diff)
Create public bodies in multiple locales when importing from CSV
Diffstat (limited to 'app/controllers/admin_public_body_controller.rb')
-rw-r--r--app/controllers/admin_public_body_controller.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/admin_public_body_controller.rb b/app/controllers/admin_public_body_controller.rb
index f88b25572..021122734 100644
--- a/app/controllers/admin_public_body_controller.rb
+++ b/app/controllers/admin_public_body_controller.rb
@@ -154,10 +154,10 @@ class AdminPublicBodyController < AdminController
else
raise "internal error, unknown button label"
end
-
+
# Try with dry run first
csv_contents = params[:csv_file].read
- en = PublicBody.import_csv(csv_contents, params[:tag], true, admin_http_auth_user())
+ en = PublicBody.import_csv(csv_contents, params[:tag], true, admin_http_auth_user(), I18n.available_locales)
errors = en[0]
notes = en[1]
@@ -166,7 +166,7 @@ class AdminPublicBodyController < AdminController
notes.push("Dry run was successful, real run would do as above.")
else
# And if OK, with real run
- en = PublicBody.import_csv(csv_contents, params[:tag], false, admin_http_auth_user())
+ en = PublicBody.import_csv(csv_contents, params[:tag], false, admin_http_auth_user(), available_locales)
errors = en[0]
notes = en[1]
if errors.size != 0