From 0616350fdf28997e7ab21e66519be6304887b2ed Mon Sep 17 00:00:00 2001 From: Godwin Date: Fri, 6 Jan 2017 12:57:04 -0800 Subject: [PATCH] Fixed bug saving user profile when no locale is selected --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index a1093f0..e704c49 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -326,7 +326,7 @@ class ApplicationController < LinguaFrancaApplicationController return do_403 unless logged_in? current_user.firstname = params[:name] current_user.lastname = nil - current_user.languages = params[:languages].keys + current_user.languages = (params[:languages] || { I18n.locale.to_s => true }).keys current_user.is_subscribed = params[:email_subscribe].present? current_user.save redirect_to settings_path