Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Davila <rdavila84@gmail.com>2017-05-25 18:22:45 +0300
committerRuben Davila <rdavila84@gmail.com>2017-05-25 18:22:45 +0300
commit5c921809cd86e1031a6a5075da142fef3bb01d6d (patch)
tree0c04cf9d24f9e94c2bf5dfd709c22f142bec5e77 /lib/api/api.rb
parentd07e85e1033f8026f155c6171cb3ebcd6b93d9ed (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 'lib/api/api.rb')
-rw-r--r--lib/api/api.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/api/api.rb b/lib/api/api.rb
index 52cd7cbe3db..ac113c5200d 100644
--- a/lib/api/api.rb
+++ b/lib/api/api.rb
@@ -45,9 +45,9 @@ module API
end
before { allow_access_with_scope :api }
- before { Gitlab::I18n.set_locale(current_user) }
+ before { Gitlab::I18n.locale = current_user&.preferred_language }
- after { Gitlab::I18n.reset_locale }
+ after { Gitlab::I18n.use_default_locale }
rescue_from Gitlab::Access::AccessDeniedError do
rack_response({ 'message' => '403 Forbidden' }.to_json, 403)