From a85a80f7e06fb52197787fa0947cb9a0aaee570c Mon Sep 17 00:00:00 2001 From: Petko Bordjukov Date: Tue, 2 Sep 2014 18:43:26 +0300 Subject: [PATCH] Tweak redirection when the user has no speaker profile --- app/controllers/sessions_controller.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index a96dbeb..8848ad2 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -1,7 +1,9 @@ class SessionsController < Devise::SessionsController def after_sign_in_path_for(user) - if user.speaker_profile.present? - stored_location_for(user) || signed_in_root_path(user) + stored_location = stored_location_for user + + if user.speaker_profile.present? || stored_location + stored_location || signed_in_root_path(user) else flash[:alert] = I18n.t(:please_fill_in_your_speaker_profile) edit_user_registration_path