aboutsummaryrefslogtreecommitdiffstats
path: root/models/project
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2023-07-26 04:27:44 +0800
committerGitHub <noreply@github.com>2023-07-25 20:27:44 +0000
commitc7f6e9fc2f1812f517a5a4b6f3864a7bb51523fc (patch)
treeb4f8a1dff916b8682819833c3a1a518100bd06bd /models/project
parent5a56f9699c904e45e62d2bd97b3d0cf5b6f5cb9c (diff)
downloadgitea-c7f6e9fc2f1812f517a5a4b6f3864a7bb51523fc.tar.gz
gitea-c7f6e9fc2f1812f517a5a4b6f3864a7bb51523fc.zip
Update xorm version (#26128)
Test new xorm version compatible with Gitea --------- Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Diffstat (limited to 'models/project')
-rw-r--r--models/project/project.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/models/project/project.go b/models/project/project.go
index 6fa2adf604..17348a9443 100644
--- a/models/project/project.go
+++ b/models/project/project.go
@@ -241,7 +241,10 @@ func GetSearchOrderByBySortType(sortType string) db.SearchOrderBy {
// FindProjects returns a list of all projects that have been created in the repository
func FindProjects(ctx context.Context, opts SearchOptions) ([]*Project, int64, error) {
- e := db.GetEngine(ctx).Where(opts.toConds()).OrderBy(opts.OrderBy.String())
+ e := db.GetEngine(ctx).Where(opts.toConds())
+ if opts.OrderBy.String() != "" {
+ e = e.OrderBy(opts.OrderBy.String())
+ }
projects := make([]*Project, 0, setting.UI.IssuePagingNum)
if opts.Page > 0 {