From bebb9203df3d4fec527868b501d068f0bee50511 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Fri, 24 Sep 2010 10:22:53 +0100 Subject: [PATCH] Fix errors when an existing user tries to agree to the new terms --- app/controllers/user_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 17f52fd40..2e80682a3 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -46,7 +46,7 @@ class UserController < ApplicationController @title = t 'user.terms.title' @user = User.new(params[:user]) if params[:user] - if params[:user][:openid_url] and @user.pass_crypt.empty? + if params[:user] and params[:user][:openid_url] and @user.pass_crypt.empty? # We are creating an account with OpenID and no password # was specified so create a random one @user.pass_crypt = ActiveSupport::SecureRandom.base64(16) @@ -60,7 +60,7 @@ class UserController < ApplicationController elsif @user.terms_agreed? # Already agreed to terms, so just show settings redirect_to :action => :account, :display_name => @user.display_name - elsif params[:user][:openid_url] + elsif params[:user] and params[:user][:openid_url] # Verify OpenID before moving on session[:new_user] = @user openid_verify(params[:user][:openid_url], @user) -- 2.43.2