]> source.dussan.org Git - redmine.git/commitdiff
add empty lines after guard clause to app/models/user.rb
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 9 Jul 2020 15:18:16 +0000 (15:18 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 9 Jul 2020 15:18:16 +0000 (15:18 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@19871 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/user.rb

index 9a073f1bd7191cae8148fb5209fe126178a7c9c8..6102f52c0d9a178f7539ed71ea4ce7d29a2300b4 100644 (file)
@@ -226,6 +226,7 @@ class User < Principal
 
     # Make sure no one can sign in with an empty login or password
     return nil if login.empty? || password.empty?
+
     user = find_by_login(login)
     if user
       # user is already in local database
@@ -604,6 +605,7 @@ class User < Principal
   def roles_for_project(project)
     # No role on archived projects
     return [] if project.nil? || project.archived?
+
     if membership = membership(project)
       membership.roles.to_a
     elsif project.is_public?
@@ -707,6 +709,7 @@ class User < Principal
 
       roles = roles_for_project(context)
       return false unless roles
+
       roles.any? {|role|
         (context.is_public? || role.member?) &&
         role.allowed_to?(action) &&
@@ -841,6 +844,7 @@ class User < Principal
     transaction do
       User.where("salt IS NULL OR salt = ''").find_each do |user|
         next if user.hashed_password.blank?
+
         salt = User.generate_salt
         hashed_password = User.hash_password("#{salt}#{user.hashed_password}")
         User.where(:id => user.id).update_all(:salt => salt, :hashed_password => hashed_password)
@@ -859,6 +863,7 @@ class User < Principal
 
   def validate_password_length
     return if password.blank? && generate_password?
+
     # Password length validation based on setting
     if !password.nil? && password.size < Setting.password_min_length.to_i
       errors.add(:password, :too_short, :count => Setting.password_min_length.to_i)