Remove unecessary code.

This commit is contained in:
Guo Xiang Tan 2018-10-02 15:20:19 +08:00
parent f34d9202b4
commit 3b1e13e4ab
2 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@ class MaxUsernameLengthValidator
def valid_value?(value)
return false if value < SiteSetting.min_username_length
@username = User.where('length(username) > ?', value).pluck(:username).first
@username.blank? ? true : false
@username.blank?
end
def error_message

View File

@ -6,7 +6,7 @@ class MinUsernameLengthValidator
def valid_value?(value)
return false if value > SiteSetting.max_username_length
@username = User.where('length(username) < ?', value).pluck(:username).first
@username.blank? ? true : false
@username.blank?
end
def error_message