diff options
author | Ruben Davila <rdavila84@gmail.com> | 2017-05-25 18:22:45 +0300 |
---|---|---|
committer | Ruben Davila <rdavila84@gmail.com> | 2017-05-25 18:22:45 +0300 |
commit | 5c921809cd86e1031a6a5075da142fef3bb01d6d (patch) | |
tree | 0c04cf9d24f9e94c2bf5dfd709c22f142bec5e77 /app/controllers/application_controller.rb | |
parent | d07e85e1033f8026f155c6171cb3ebcd6b93d9ed (diff) |
Bugfix: Always use the default language when generating emails.
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.rb | 8 |
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 |