diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2022-06-05 03:18:50 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-04 20:18:50 +0100 |
commit | 12c742f8dc25e4148c44d1265d119c35f161bf74 (patch) | |
tree | 0c35f1de4cf7bdea1dfc8b03468f3616d0c82796 /models/repo_collaboration.go | |
parent | 449ea6005fb613212102126ff267f5c16f7c40b8 (diff) | |
download | gitea-12c742f8dc25e4148c44d1265d119c35f161bf74.tar.gz gitea-12c742f8dc25e4148c44d1265d119c35f161bf74.zip |
Fix order by parameter (#19849)
Upgrade builder to v0.3.11
Upgrade xorm to v1.3.1 and fixed some hidden bugs.
Replace #19821
Replace #19834
Included #19850
Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'models/repo_collaboration.go')
-rw-r--r-- | models/repo_collaboration.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/models/repo_collaboration.go b/models/repo_collaboration.go index e20e96815c..8cbd836a42 100644 --- a/models/repo_collaboration.go +++ b/models/repo_collaboration.go @@ -25,9 +25,8 @@ func addCollaborator(ctx context.Context, repo *repo_model.Repository, u *user_m RepoID: repo.ID, UserID: u.ID, } - e := db.GetEngine(ctx) - has, err := e.Get(collaboration) + has, err := db.GetByBean(ctx, collaboration) if err != nil { return err } else if has { @@ -35,7 +34,7 @@ func addCollaborator(ctx context.Context, repo *repo_model.Repository, u *user_m } collaboration.Mode = perm.AccessModeWrite - if _, err = e.InsertOne(collaboration); err != nil { + if err = db.Insert(ctx, collaboration); err != nil { return err } |