modes/repo: syntax fix for PR #5234

pull/5315/head
Unknwon 2018-06-16 16:48:17 +08:00
parent 08ae0dd74b
commit 86a27cf16d
No known key found for this signature in database
GPG Key ID: 7A02C406FAC875A2
3 changed files with 4 additions and 4 deletions

View File

@ -16,7 +16,7 @@ import (
"github.com/gogs/gogs/pkg/setting"
)
const APP_VER = "0.11.56.0613"
const APP_VER = "0.11.57.0616"
func init() {
setting.AppVer = APP_VER

View File

@ -1653,11 +1653,11 @@ func SearchRepositoryByName(opts *SearchRepoOptions) (repos []*Repository, count
// this does not include other people's private repositories even if opts.UserID is an admin.
if !opts.Private && opts.UserID > 0 {
sess.Join("LEFT", "access", "access.repo_id = repo.id").
Where("(repo.owner_id = ? OR access.user_id = ? OR repo.is_private = ? OR (repo.is_private = ? AND (repo.allow_public_wiki = ? OR repo.allow_public_issues = ?)))", opts.UserID, opts.UserID, false, true, true, true)
Where("repo.owner_id = ? OR access.user_id = ? OR repo.is_private = ? OR (repo.is_private = ? AND (repo.allow_public_wiki = ? OR repo.allow_public_issues = ?))", opts.UserID, opts.UserID, false, true, true, true)
} else {
// Only return public repositories if opts.Private is not set
if !opts.Private {
sess.And("(repo.is_private = ? OR (repo.is_private = ? AND (repo.allow_public_wiki = ? OR repo.allow_public_issues = ?))", false, true, true, true)
sess.And("repo.is_private = ? OR (repo.is_private = ? AND (repo.allow_public_wiki = ? OR repo.allow_public_issues = ?))", false, true, true, true)
}
}
if len(opts.Keyword) > 0 {

View File

@ -1 +1 @@
0.11.56.0613
0.11.57.0616