##// END OF EJS Templates
Don't use && return....
Jean-Philippe Lang -
r10991:e355a55e3c69
parent child
Show More
@@ -44,7 +44,7 class AccountController < ApplicationController
44
44
45 # Lets user choose a new password
45 # Lets user choose a new password
46 def lost_password
46 def lost_password
47 redirect_to(home_url) && return unless Setting.lost_password?
47 (redirect_to(home_url); return) unless Setting.lost_password?
48 if params[:token]
48 if params[:token]
49 @token = Token.find_by_action_and_value("recovery", params[:token].to_s)
49 @token = Token.find_by_action_and_value("recovery", params[:token].to_s)
50 if @token.nil? || @token.expired?
50 if @token.nil? || @token.expired?
@@ -94,7 +94,7 class AccountController < ApplicationController
94
94
95 # User self-registration
95 # User self-registration
96 def register
96 def register
97 redirect_to(home_url) && return unless Setting.self_registration? || session[:auth_source_registration]
97 (redirect_to(home_url); return) unless Setting.self_registration? || session[:auth_source_registration]
98 if request.get?
98 if request.get?
99 session[:auth_source_registration] = nil
99 session[:auth_source_registration] = nil
100 @user = User.new(:language => current_language.to_s)
100 @user = User.new(:language => current_language.to_s)
@@ -176,7 +176,7 class AccountController < ApplicationController
176 user = User.find_or_initialize_by_identity_url(identity_url)
176 user = User.find_or_initialize_by_identity_url(identity_url)
177 if user.new_record?
177 if user.new_record?
178 # Self-registration off
178 # Self-registration off
179 redirect_to(home_url) && return unless Setting.self_registration?
179 (redirect_to(home_url); return) unless Setting.self_registration?
180
180
181 # Create on the fly
181 # Create on the fly
182 user.login = registration['nickname'] unless registration['nickname'].nil?
182 user.login = registration['nickname'] unless registration['nickname'].nil?
@@ -141,7 +141,8 class ProjectsController < ApplicationController
141 def show
141 def show
142 if params[:jump]
142 if params[:jump]
143 # try to redirect to the requested menu item
143 # try to redirect to the requested menu item
144 redirect_to_project_menu_item(@project, params[:jump]) && return
144 redirect_to_project_menu_item(@project, params[:jump])
145 return
145 end
146 end
146
147
147 @users_by_role = @project.users_by_role
148 @users_by_role = @project.users_by_role
General Comments 0
You need to be logged in to leave comments. Login now