]> git.openstreetmap.org Git - rails.git/commitdiff
Avoid singleton serialisation errors
authorTom Hughes <tom@compton.nu>
Wed, 7 Aug 2013 16:35:10 +0000 (17:35 +0100)
committerTom Hughes <tom@compton.nu>
Sat, 21 Sep 2013 11:03:53 +0000 (12:03 +0100)
app/controllers/user_controller.rb

index 6f2894e3da454764dbc673241500a947dc17b12e..7a0fa5f272d324fed0730b5aec107df09a4f1d4a 100644 (file)
@@ -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