diff --git a/object/check.go b/object/check.go index b8713e77..3c970303 100644 --- a/object/check.go +++ b/object/check.go @@ -87,9 +87,9 @@ func CheckUserSignup(application *Application, organization *Organization, usern if application.IsSignupItemVisible("Display name") { if displayName == "" { return "displayName cannot be blank" - } else if application.GetSignupItemRule("Display name") == "Personal" { - if !isValidPersonalName(displayName) { - return "displayName is not valid personal name" + } else if application.GetSignupItemRule("Display name") == "Real name" { + if !isValidRealName(displayName) { + return "displayName is not valid real name" } } } diff --git a/object/check_util.go b/object/check_util.go index 50f104bd..84856f54 100644 --- a/object/check_util.go +++ b/object/check_util.go @@ -16,16 +16,16 @@ package object import "regexp" -var rePersonalName *regexp.Regexp +var reRealName *regexp.Regexp func init() { var err error - rePersonalName, err = regexp.Compile("^[\u4E00-\u9FA5]{2,3}(?:·[\u4E00-\u9FA5]{2,3})*$") + reRealName, err = regexp.Compile("^[\u4E00-\u9FA5]{2,3}(?:·[\u4E00-\u9FA5]{2,3})*$") if err != nil { panic(err) } } -func isValidPersonalName(s string) bool { - return rePersonalName.MatchString(s) +func isValidRealName(s string) bool { + return reRealName.MatchString(s) }