From 8cd0026cde630dc6a67ae7fe3eb9e6819dc23427 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 16 Nov 2017 10:58:09 -0500 Subject: [PATCH] FIX: If there is an invalid locale in the site setting, default to en --- lib/tasks/db.rake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake index e6d5040a2a6..f4ead49abbf 100644 --- a/lib/tasks/db.rake +++ b/lib/tasks/db.rake @@ -1,6 +1,10 @@ # we should set the locale before the migration task 'set_locale' do - I18n.locale = (SiteSetting.default_locale || :en) rescue :en + begin + I18n.locale = (SiteSetting.default_locale || :en) rescue :en + rescue I18n::InvalidLocale + I18n.locale = :en + end end task 'db:environment:set', [:multisite] => [:load_config] do |_, args|