Skip to content

Commit 665993e

Browse files
committed
Move join into setupsession
1 parent e48dbff commit 665993e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

models/issue.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,7 +1210,8 @@ func (opts *IssuesOptions) setupSession(sess *xorm.Session) {
12101210
}
12111211

12121212
if opts.IsArchived != util.OptionalBoolNone {
1213-
sess.And(builder.Eq{"repository.is_archived": opts.IsArchived.IsTrue()})
1213+
sess.Join("INNER", "repository", "`issue`.repo_id = `repository`.id").
1214+
And(builder.Eq{"repository.is_archived": opts.IsArchived.IsTrue()})
12141215
}
12151216

12161217
if opts.LabelIDs != nil {
@@ -1292,8 +1293,6 @@ func GetRepoIDsForIssuesOptions(opts *IssuesOptions, user *User) ([]int64, error
12921293
sess := x.NewSession()
12931294
defer sess.Close()
12941295

1295-
sess.Join("INNER", "repository", "`issue`.repo_id = `repository`.id")
1296-
12971296
opts.setupSession(sess)
12981297

12991298
accessCond := accessibleRepositoryCondition(user)

0 commit comments

Comments
 (0)