mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: don't suggest name when email is empty
This commit is contained in:
parent
d38c4d5f74
commit
49996bcdea
@ -171,9 +171,8 @@ class User < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.suggest_name(email)
|
def self.suggest_name(email)
|
||||||
return "" unless email
|
return "" if email.blank?
|
||||||
name = email.split(/[@\+]/)[0]
|
name = email.split(/[@\+]/)[0].gsub(".", " ")
|
||||||
name = name.gsub(".", " ")
|
|
||||||
name.titleize
|
name.titleize
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user