diff --git a/app/controllers/admin/import_data_controller.rb b/app/controllers/admin/import_data_controller.rb index c4f25da1f..7e3425c9d 100644 --- a/app/controllers/admin/import_data_controller.rb +++ b/app/controllers/admin/import_data_controller.rb @@ -22,20 +22,21 @@ class Admin::ImportDataController < OrbitBackendController @roles = Role.all @teacher = User.new I18n.locale = :zh_tw - if hash['teacher_zh_tw'].blank? && hash['teacher_en'].blank? - @teacher.first_name = "Please Fill the Name" + if !hash['teacher_zh_tw'].blank? + @teacher.first_name = hash['teacher_zh_tw'] elsif hash['teacher_zh_tw'].blank? && !hash['teacher_en'].blank? @teacher.first_name = hash['teacher_en'] - else - @teacher.first_name = hash['teacher_zh_tw'] - end - I18n.locale = :en - if hash['teacher_zh_tw'].blank? && hash['teacher_en'].blank? + elsif hash['teacher_zh_tw'].blank? && hash['teacher_en'].blank? @teacher.first_name = "Please Fill the Name" + end + + I18n.locale = :en + if !hash['teacher_en'].blank? + @teacher.first_name = hash['teacher_en'] elsif hash['teacher_en'].blank? && !hash['teacher_zh_tw'].blank? @teacher.first_name = hash['teacher_zh_tw'] - elsif !hash['teacher_en'].blank? && hash['teacher_zh_tw'].blank? - @teacher.first_name = hash['teacher_en'] + elsif hash['teacher_en'].blank? && hash['teacher_zh_tw'].blank? + @teacher.first_name = "Please Fill the Name" end #@teacher.first_name = hash['teacher_en']