From: Tom Hughes Date: Wed, 7 Aug 2013 16:35:10 +0000 (+0100) Subject: Avoid singleton serialisation errors X-Git-Tag: live~5329 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/5432409ab6d20a107debf9935e0ec55c6183fcb6 Avoid singleton serialisation errors --- 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