mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 19:03:45 +08:00
FIX: In the case of a blank name, use a SHA1
This commit is contained in:
parent
b741adb364
commit
4ed46a45ed
|
@ -28,7 +28,13 @@ class ImportScripts::JsonGeneric < ImportScripts::Base
|
|||
end
|
||||
|
||||
def username_for(name)
|
||||
name.downcase.gsub(/[^a-z0-9\-\_]/, '')
|
||||
result = name.downcase.gsub(/[^a-z0-9\-\_]/, '')
|
||||
|
||||
if result.blank?
|
||||
result = Digest::SHA1.hexdigest(name)[0...10]
|
||||
end
|
||||
|
||||
result
|
||||
end
|
||||
|
||||
def import_users
|
||||
|
|
Loading…
Reference in New Issue
Block a user