do not reload slice if already loaded

This commit is contained in:
Nicolas Gourdon
2019-04-30 22:01:16 +02:00
parent 8216a2a210
commit f6983856de
3 changed files with 10 additions and 2 deletions

View File

@@ -88,7 +88,9 @@ func (t *Team) IsMember(userID int64) bool {
}
func (t *Team) getRepositories(e Engine) error {
t.Repos = nil
if t.Repos != nil {
return nil
}
return e.Join("INNER", "team_repo", "repository.id = team_repo.repo_id").
Where("team_repo.team_id=?", t.ID).
OrderBy("repository.name").