diff --git a/routers/web/org/setting.go b/routers/web/org/setting.go index b5653160a26d5..bd558f78b89a1 100644 --- a/routers/web/org/setting.go +++ b/routers/web/org/setting.go @@ -89,7 +89,6 @@ func SettingsPost(ctx *context.Context) { // reset ctx.org.OrgLink with new name ctx.Org.OrgLink = setting.AppSubURL + "/org/" + url.PathEscape(form.Name) log.Trace("Organization name changed: %s -> %s", org.Name, form.Name) - nameChanged = false } // In case it's just a case change. @@ -130,11 +129,6 @@ func SettingsPost(ctx *context.Context) { return } } - } else if nameChanged { - if err := repo_model.UpdateRepositoryOwnerNames(org.ID, org.Name); err != nil { - ctx.ServerError("UpdateRepository", err) - return - } } log.Trace("Organization setting updated: %s", org.Name) diff --git a/services/user/user.go b/services/user/user.go index e0815bd860791..bb3dd002ea06f 100644 --- a/services/user/user.go +++ b/services/user/user.go @@ -58,7 +58,7 @@ func RenameUser(ctx context.Context, u *user_model.User, newUserName string) err u.Name = oldUserName return err } - return nil + return repo_model.UpdateRepositoryOwnerNames(u.ID, newUserName) } ctx, committer, err := db.TxContext(ctx)