summaryrefslogtreecommitdiffstats
path: root/models/issue_lock.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/issue_lock.go')
-rw-r--r--models/issue_lock.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/models/issue_lock.go b/models/issue_lock.go
index 78b2c5cdb7..f7474bfd1d 100644
--- a/models/issue_lock.go
+++ b/models/issue_lock.go
@@ -4,6 +4,8 @@
package models
+import "code.gitea.io/gitea/models/db"
+
// IssueLockOptions defines options for locking and/or unlocking an issue/PR
type IssueLockOptions struct {
Doer *User
@@ -35,7 +37,7 @@ func updateIssueLock(opts *IssueLockOptions, lock bool) error {
commentType = CommentTypeUnlock
}
- sess := x.NewSession()
+ sess := db.DefaultContext().NewSession()
defer sess.Close()
if err := sess.Begin(); err != nil {
return err