Browse Source

Merge branch 'fix-1827' of https://git.openi.org.cn/OpenI/aiforge into fix-1827

tags/v1.22.4.1^2
zhoupzh 3 years ago
parent
commit
25e49b7b23
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      models/dataset.go

+ 4
- 3
models/dataset.go View File

@@ -62,19 +62,20 @@ func (datasets DatasetList) loadAttributes(e Engine) error {
}

set := make(map[int64]struct{})
userIdSet := make(map[int64]struct{})
datasetIDs := make([]int64, len(datasets))
for i := range datasets {
set[datasets[i].UserID] = struct{}{}
userIdSet[datasets[i].UserID] = struct{}{}
set[datasets[i].RepoID] = struct{}{}
datasetIDs[i] = datasets[i].ID
}

// Load owners.
users := make(map[int64]*User, len(set))
users := make(map[int64]*User, len(userIdSet))
repos := make(map[int64]*Repository, len(set))
if err := e.
Where("id > 0").
In("id", keysInt64(set)).
In("id", keysInt64(userIdSet)).
Find(&users); err != nil {
return fmt.Errorf("find users: %v", err)
}


Loading…
Cancel
Save