1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 10:18:38 +00:00

Remove NewSession method from db.Engine interface (#17577)

* Remove NewSession method from db.Engine interface

* Fix bug

* Some improvements

* Fix bug

* Fix test

* Use XXXBean instead of XXXExample
This commit is contained in:
Lunny Xiao
2021-11-21 23:41:00 +08:00
committed by GitHub
parent 0add627182
commit d710af6669
44 changed files with 600 additions and 620 deletions

View File

@@ -279,8 +279,7 @@ func IsUserRealRepoAdmin(repo *Repository, user *User) (bool, error) {
return true, nil
}
sess := db.NewSession(db.DefaultContext)
defer sess.Close()
sess := db.GetEngine(db.DefaultContext)
if err := repo.getOwner(sess); err != nil {
return false, err