diff options
author | Ethan Koenig <ethantkoenig@gmail.com> | 2017-06-30 12:50:57 -0400 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2017-07-01 14:08:43 +0300 |
commit | eae9154811b660bcf2333f349176af7ed96b5924 (patch) | |
tree | 1bb6f622d6e9b0f2440ddd440cdbc387bb8ac3e2 /models | |
parent | 3c0705ecf3167c1d782a5f3ed26ff0041bc4879d (diff) | |
download | gitea-eae9154811b660bcf2333f349176af7ed96b5924.tar.gz gitea-eae9154811b660bcf2333f349176af7ed96b5924.zip |
Fix SQL bug in models.PullRequests
Diffstat (limited to 'models')
-rw-r--r-- | models/pull.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/models/pull.go b/models/pull.go index 1db0a89741..3d2e5c6d97 100644 --- a/models/pull.go +++ b/models/pull.go @@ -688,8 +688,6 @@ func listPullRequestStatement(baseRepoID int64, opts *PullRequestsOptions) (*xor sess.And("issue.is_closed=?", opts.State == "closed") } - sortIssuesSession(sess, opts.SortType) - if labelIDs, err := base.StringsToInt64s(opts.Labels); err != nil { return nil, err } else if len(labelIDs) > 0 { @@ -723,6 +721,7 @@ func PullRequests(baseRepoID int64, opts *PullRequestsOptions) ([]*PullRequest, prs := make([]*PullRequest, 0, ItemsPerPage) findSession, err := listPullRequestStatement(baseRepoID, opts) + sortIssuesSession(findSession, opts.SortType) if err != nil { log.Error(4, "listPullRequestStatement", err) return nil, maxResults, err |