diff options
author | Unknown <joe2010xtmf@163.com> | 2014-07-12 00:55:35 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-07-12 00:55:35 -0400 |
commit | 3969d704a014c54e55281cd9b30e622acbd447c4 (patch) | |
tree | 7547f6a6672a4d22fe2844ca24285b83d7384a86 /models | |
parent | 0f907301b7fbd05faf07bc22b3316ae1093c6724 (diff) | |
parent | 590f9e599c9a1d544623c79a0064a09ca005f2d8 (diff) | |
download | gitea-3969d704a014c54e55281cd9b30e622acbd447c4.tar.gz gitea-3969d704a014c54e55281cd9b30e622acbd447c4.zip |
Merge branch 'dev' of github.com:gogits/gogs into dev
Diffstat (limited to 'models')
-rw-r--r-- | models/user.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/models/user.go b/models/user.go index 13c9148473..a46232427e 100644 --- a/models/user.go +++ b/models/user.go @@ -297,10 +297,12 @@ func ChangeUserName(user *User, newUserName string) (err error) { } for j := range accesses { - accesses[j].UserName = newUserName - accesses[j].RepoName = newUserName + "/" + repos[i].LowerName - if err = UpdateAccessWithSession(sess, &accesses[j]); err != nil { - return err + // if the access is not the user's access (already updated above) + if accesses[j].UserName != user.LowerName { + accesses[j].RepoName = newUserName + "/" + repos[i].LowerName + if err = UpdateAccessWithSession(sess, &accesses[j]); err != nil { + return err + } } } } |