mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Password required flag should be cleared whenever clearing the raw password (#5384)
This commit is contained in:
@@ -3,7 +3,8 @@ require_dependency "common_passwords/common_passwords"
|
||||
class PasswordValidator < ActiveModel::EachValidator
|
||||
|
||||
def validate_each(record, attribute, value)
|
||||
return unless record.password_required?
|
||||
return unless record.password_validation_required?
|
||||
|
||||
if value.nil?
|
||||
record.errors.add(attribute, :blank)
|
||||
elsif value.length < SiteSetting.min_admin_password_length && (record.admin? || is_developer?(record.email))
|
||||
|
Reference in New Issue
Block a user