diff options
author | Andrey Nering <andrey.nering@gmail.com> | 2017-01-24 00:39:58 -0200 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-01-24 10:39:58 +0800 |
commit | 521d429b58c78864c1809b67005ce0bc80d2e484 (patch) | |
tree | e81fa84cc2a74e9e1d6b2f7b7456c863214a46a7 /models/star.go | |
parent | 3461003a0fead49e5c19e092aec30adf349052ab (diff) | |
download | gitea-521d429b58c78864c1809b67005ce0bc80d2e484.tar.gz gitea-521d429b58c78864c1809b67005ce0bc80d2e484.zip |
Fix link of some repos on stars page (#737)
Link was wrong the repo was of another owner
Diffstat (limited to 'models/star.go')
-rw-r--r-- | models/star.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/models/star.go b/models/star.go index 923bab57b5..997b223a18 100644 --- a/models/star.go +++ b/models/star.go @@ -81,7 +81,15 @@ func (u *User) GetStarredRepos(private bool) (repos []*Repository, err error) { sess = sess.And("is_private = ?", false) } - err = sess. - Find(&repos) + if err = sess.Find(&repos); err != nil { + return + } + + for _, repo := range repos { + if err = repo.GetOwner(); err != nil { + return + } + } + return } |