From aa6f4d4fb98585b5bb68df767eb3591692be90e6 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Thu, 2 Jul 2020 12:56:20 +0200 Subject: [PATCH] Don't set unavailable locales on the current user --- app/helpers/i18n_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/i18n_helper.rb b/app/helpers/i18n_helper.rb index c37d036f62..5ce1539f05 100644 --- a/app/helpers/i18n_helper.rb +++ b/app/helpers/i18n_helper.rb @@ -7,7 +7,7 @@ module I18nHelper end # After logging in, check if the user chose a locale before - if current_user_locale.nil? && cookies[:locale] + if current_user_locale.nil? && cookies[:locale] && available_locale?(params[:locale]) spree_current_user&.update!(locale: params[:locale]) end