From 6a969681cd862bf153fa7921485278be1e8a092a Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 8 May 2022 15:46:34 +0200 Subject: Delete related PullAutoMerge and ReviewState on User/Repo Deletion (#19649) * delete pullautomerges on repo/user deletion * delete reviewstates on repo/user deletion * optimize automerhe code * add index to reviewstate --- services/pull/merge.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'services/pull/merge.go') diff --git a/services/pull/merge.go b/services/pull/merge.go index b14abcd780..e054df716b 100644 --- a/services/pull/merge.go +++ b/services/pull/merge.go @@ -141,7 +141,7 @@ func Merge(ctx context.Context, pr *models.PullRequest, doer *user_model.User, b defer pullWorkingPool.CheckOut(fmt.Sprint(pr.ID)) // Removing an auto merge pull and ignore if not exist - if err := pull_model.RemoveScheduledAutoMerge(db.DefaultContext, doer, pr.ID, false); err != nil && !models.IsErrNotExist(err) { + if err := pull_model.DeleteScheduledAutoMerge(db.DefaultContext, pr.ID); err != nil && !db.IsErrNotExist(err) { return err } -- cgit v1.2.3