mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06: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
|
end
|
||||||
|
|
||||||
def username_for(name)
|
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
|
end
|
||||||
|
|
||||||
def import_users
|
def import_users
|
||||||
|
Loading…
Reference in New Issue
Block a user