Don't use && return.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11221 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2013-01-20 13:54:42 +00:00
parent b07a27b028
commit e355a55e3c
2 changed files with 5 additions and 4 deletions

View File

@ -44,7 +44,7 @@ class AccountController < ApplicationController
# Lets user choose a new password
def lost_password
redirect_to(home_url) && return unless Setting.lost_password?
(redirect_to(home_url); return) unless Setting.lost_password?
if params[:token]
@token = Token.find_by_action_and_value("recovery", params[:token].to_s)
if @token.nil? || @token.expired?
@ -94,7 +94,7 @@ class AccountController < ApplicationController
# User self-registration
def register
redirect_to(home_url) && return unless Setting.self_registration? || session[:auth_source_registration]
(redirect_to(home_url); return) unless Setting.self_registration? || session[:auth_source_registration]
if request.get?
session[:auth_source_registration] = nil
@user = User.new(:language => current_language.to_s)
@ -176,7 +176,7 @@ class AccountController < ApplicationController
user = User.find_or_initialize_by_identity_url(identity_url)
if user.new_record?
# Self-registration off
redirect_to(home_url) && return unless Setting.self_registration?
(redirect_to(home_url); return) unless Setting.self_registration?
# Create on the fly
user.login = registration['nickname'] unless registration['nickname'].nil?

View File

@ -141,7 +141,8 @@ class ProjectsController < ApplicationController
def show
if params[:jump]
# try to redirect to the requested menu item
redirect_to_project_menu_item(@project, params[:jump]) && return
redirect_to_project_menu_item(@project, params[:jump])
return
end
@users_by_role = @project.users_by_role