Skip to content
Snippets Groups Projects
Verified Commit fb46abbe authored by Evan Rolfe's avatar Evan Rolfe Committed by Andrej Shadura
Browse files

Simplify password validation

Partially cherry-picked from 362bdc3a
parent 11a7de14
Branches
No related tags found
1 merge request!21OBS SSO implementation
......@@ -362,10 +362,10 @@ class User < ActiveRecord::Base
# check that the password hash type has not been set if no new password
# has been provided
if @new_hash_type and (!@new_password or password.nil?)
return unless @new_hash_type && (!@new_password || password.nil?)
errors.add(:password_hash_type, 'cannot be changed unless a new password has been provided.')
end
end
validates :login, :email, :password, :password_hash_type, :state,
presence: { message: 'must be given' }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment