Don't redirect from user#terms to login if the user is logged in
authorTom Hughes <tom@compton.nu>
Sun, 29 Sep 2013 14:43:34 +0000 (15:43 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 29 Sep 2013 14:43:34 +0000 (15:43 +0100)
app/controllers/user_controller.rb

index 325d7b3fe380ae4dd37f4c6be0e8e18c5cfae44d..3d97c58f1753dd10c91f7c2533ec7bb35591d6f3 100644 (file)
@@ -30,7 +30,7 @@ class UserController < ApplicationController
       if @user and @user.terms_agreed?
         # Already agreed to terms, so just show settings
         redirect_to :action => :account, :display_name => @user.display_name
-      elsif session[:new_user].nil?
+      elsif @user.nil? and session[:new_user].nil?
         redirect_to :action => :login, :referer => request.fullpath
       end
     end