|
|
@ -230,11 +230,11 @@ func ChangeUserName(user *User, newUserName string) (err error) { |
|
|
|
accesses[i].UserName = newUserName |
|
|
|
accesses[i].UserName = newUserName |
|
|
|
if strings.HasPrefix(accesses[i].RepoName, user.LowerName+"/") { |
|
|
|
if strings.HasPrefix(accesses[i].RepoName, user.LowerName+"/") { |
|
|
|
accesses[i].RepoName = strings.Replace(accesses[i].RepoName, user.LowerName, newUserName, 1) |
|
|
|
accesses[i].RepoName = strings.Replace(accesses[i].RepoName, user.LowerName, newUserName, 1) |
|
|
|
|
|
|
|
} |
|
|
|
if err = UpdateAccessWithSession(sess, &accesses[i]); err != nil { |
|
|
|
if err = UpdateAccessWithSession(sess, &accesses[i]); err != nil { |
|
|
|
return err |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
repos, err := GetRepositories(user, true) |
|
|
|
repos, err := GetRepositories(user, true) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|