Browse Source

Fixed bug saving user profile when no locale is selected

development
Godwin 8 years ago
committed by GitHub
parent
commit
0616350fdf
  1. 2
      app/controllers/application_controller.rb

2
app/controllers/application_controller.rb

@ -326,7 +326,7 @@ class ApplicationController < LinguaFrancaApplicationController
return do_403 unless logged_in? return do_403 unless logged_in?
current_user.firstname = params[:name] current_user.firstname = params[:name]
current_user.lastname = nil 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.is_subscribed = params[:email_subscribe].present?
current_user.save current_user.save
redirect_to settings_path redirect_to settings_path

Loading…
Cancel
Save