From 5c921809cd86e1031a6a5075da142fef3bb01d6d Mon Sep 17 00:00:00 2001 From: Ruben Davila Date: Thu, 25 May 2017 10:22:45 -0500 Subject: 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. --- app/mailers/base_mailer.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/mailers/base_mailer.rb') diff --git a/app/mailers/base_mailer.rb b/app/mailers/base_mailer.rb index d2980db218a..654468bc7fe 100644 --- a/app/mailers/base_mailer.rb +++ b/app/mailers/base_mailer.rb @@ -1,4 +1,6 @@ class BaseMailer < ActionMailer::Base + around_action :render_with_default_locale + helper ApplicationHelper helper MarkupHelper @@ -14,6 +16,10 @@ class BaseMailer < ActionMailer::Base private + def render_with_default_locale(&block) + Gitlab::I18n.with_default_locale(&block) + end + def default_sender_address address = Mail::Address.new(Gitlab.config.gitlab.email_from) address.display_name = Gitlab.config.gitlab.email_display_name -- cgit v1.2.3