1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 10:18:38 +00:00
This commit is contained in:
Unknwon
2015-09-17 17:21:27 -04:00
parent 3fb1b6a608
commit acf428863c
2 changed files with 11 additions and 4 deletions

View File

@@ -49,7 +49,7 @@ func SettingsPost(ctx *middleware.Context, form auth.UpdateProfileForm) {
}
// Check if user name has been changed.
if ctx.User.Name != form.Name {
if ctx.User.LowerName != strings.ToLower(form.Name) {
if err := models.ChangeUserName(ctx.User, form.Name); err != nil {
switch {
case models.IsErrUserAlreadyExist(err):
@@ -70,8 +70,10 @@ func SettingsPost(ctx *middleware.Context, form auth.UpdateProfileForm) {
return
}
log.Trace("User name changed: %s -> %s", ctx.User.Name, form.Name)
ctx.User.Name = form.Name
}
// In case it's just a case change.
ctx.User.Name = form.Name
ctx.User.LowerName = strings.ToLower(form.Name)
ctx.User.FullName = form.FullName
ctx.User.Email = form.Email