Skip to content

Commit b072907

Browse files
authored
Fix admin user list (#15358) (#15359)
* Fix `admin user list` (#15358) * fix routers/api/v1/repo/issue.go
1 parent 942b036 commit b072907

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

models/user.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,10 @@ func (u *User) GetEmail() string {
239239
return u.Email
240240
}
241241

242-
// GetAllUsers returns a slice of all users found in DB.
242+
// GetAllUsers returns a slice of all individual users found in DB.
243243
func GetAllUsers() ([]*User, error) {
244244
users := make([]*User, 0)
245-
return users, x.OrderBy("id").Find(&users)
245+
return users, x.OrderBy("id").Where("type = ?", UserTypeIndividual).Find(&users)
246246
}
247247

248248
// IsLocal returns true if user login type is LoginPlain.

routers/api/v1/repo/issue.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ func SearchIssues(ctx *context.APIContext) {
141141
keyword = ""
142142
}
143143
var issueIDs []int64
144-
var labelIDs []int64
145144
if len(keyword) > 0 && len(repoIDs) > 0 {
146145
if issueIDs, err = issue_indexer.SearchIssuesByKeyword(repoIDs, keyword); err != nil {
147146
ctx.Error(http.StatusInternalServerError, "SearchIssuesByKeyword", err)
@@ -176,7 +175,7 @@ func SearchIssues(ctx *context.APIContext) {
176175

177176
// Only fetch the issues if we either don't have a keyword or the search returned issues
178177
// This would otherwise return all issues if no issues were found by the search.
179-
if len(keyword) == 0 || len(issueIDs) > 0 || len(labelIDs) > 0 {
178+
if len(keyword) == 0 || len(issueIDs) > 0 || len(includedLabelNames) > 0 {
180179
issuesOpt := &models.IssuesOptions{
181180
ListOptions: models.ListOptions{
182181
Page: ctx.QueryInt("page"),

0 commit comments

Comments
 (0)