summaryrefslogtreecommitdiffstats
path: root/models/project_issue.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/project_issue.go')
-rw-r--r--models/project_issue.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/models/project_issue.go b/models/project_issue.go
index 75e74295b5..6f314ca931 100644
--- a/models/project_issue.go
+++ b/models/project_issue.go
@@ -185,11 +185,12 @@ func addUpdateIssueProject(ctx context.Context, issue *Issue, doer *User, newPro
// MoveIssueAcrossProjectBoards move a card from one board to another
func MoveIssueAcrossProjectBoards(issue *Issue, board *ProjectBoard) error {
- sess := db.NewSession(db.DefaultContext)
- defer sess.Close()
- if err := sess.Begin(); err != nil {
+ ctx, committer, err := db.TxContext()
+ if err != nil {
return err
}
+ defer committer.Close()
+ sess := db.GetEngine(ctx)
var pis ProjectIssue
has, err := sess.Where("issue_id=?", issue.ID).Get(&pis)
@@ -206,7 +207,7 @@ func MoveIssueAcrossProjectBoards(issue *Issue, board *ProjectBoard) error {
return err
}
- return sess.Commit()
+ return committer.Commit()
}
func (pb *ProjectBoard) removeIssues(e db.Engine) error {