From 5432409ab6d20a107debf9935e0ec55c6183fcb6 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 7 Aug 2013 17:35:10 +0100 Subject: [PATCH] Avoid singleton serialisation errors --- app/controllers/user_controller.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 6f2894e3d..7a0fa5f27 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -26,13 +26,12 @@ class UserController < ApplicationController render :partial => "terms" else @title = t 'user.terms.title' - @user ||= session[:new_user] - if !@user - redirect_to :action => :login, :referer => request.fullpath - elsif @user.terms_agreed? + 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? + redirect_to :action => :login, :referer => request.fullpath end end end -- 2.43.2