diff --git a/app/controllers/admin/sites_controller.rb b/app/controllers/admin/sites_controller.rb index e489c889..e6a9e6f7 100644 --- a/app/controllers/admin/sites_controller.rb +++ b/app/controllers/admin/sites_controller.rb @@ -22,8 +22,8 @@ class Admin::SitesController < OrbitBackendController def update if params[:site][:default_locale] && @site.enable_language_detection.eql?(true) - Site.update_all({:enable_language_detection => false}) - elsif params[:site][:enable_language_detection] + Site.update_all({:enable_language_detection => false}) + elsif params[:site][:enable_language_detection] && @site.default_locale.present? Site.update_all({:default_locale => nil}) end # if params[:site][:enable_language_detection]