summaryrefslogtreecommitdiff
path: root/app/controllers/application_controller.rb
diff options
context:
space:
mode:
authorRuben Davila <rdavila84@gmail.com>2017-05-25 10:22:45 -0500
committerRuben Davila <rdavila84@gmail.com>2017-05-25 10:22:45 -0500
commit5c921809cd86e1031a6a5075da142fef3bb01d6d (patch)
tree0c04cf9d24f9e94c2bf5dfd709c22f142bec5e77 /app/controllers/application_controller.rb
parentd07e85e1033f8026f155c6171cb3ebcd6b93d9ed (diff)
downloadgitlab-ce-5c921809cd86e1031a6a5075da142fef3bb01d6d.tar.gz
Bugfix: Always use the default language when generating emails.32748-emails-are-being-sent-with-the-wrong-language
There was a race condition issue when the application was generating an email and was using a language that was previously being used in other request.
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 8ce9150e4a9..2c43ebe0a5a 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -275,11 +275,7 @@ class ApplicationController < ActionController::Base
request.base_url
end
- def set_locale
- Gitlab::I18n.set_locale(current_user)
-
- yield
- ensure
- Gitlab::I18n.reset_locale
+ def set_locale(&block)
+ Gitlab::I18n.with_user_locale(current_user, &block)
end
end