aboutsummaryrefslogtreecommitdiffstats
path: root/models/user.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2022-05-08 15:46:34 +0200
committerGitHub <noreply@github.com>2022-05-08 15:46:34 +0200
commit6a969681cd862bf153fa7921485278be1e8a092a (patch)
treef9a23ee85652c0ee179f215b23d928058176ae6c /models/user.go
parent4344a6410788f30848e5153f6356dcdd0774bebc (diff)
downloadgitea-6a969681cd862bf153fa7921485278be1e8a092a.tar.gz
gitea-6a969681cd862bf153fa7921485278be1e8a092a.zip
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
Diffstat (limited to 'models/user.go')
-rw-r--r--models/user.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/models/user.go b/models/user.go
index e830779629..11234a881d 100644
--- a/models/user.go
+++ b/models/user.go
@@ -16,6 +16,7 @@ import (
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/issues"
"code.gitea.io/gitea/models/organization"
+ pull_model "code.gitea.io/gitea/models/pull"
repo_model "code.gitea.io/gitea/models/repo"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/setting"
@@ -82,6 +83,8 @@ func DeleteUser(ctx context.Context, u *user_model.User) (err error) {
&Collaboration{UserID: u.ID},
&Stopwatch{UserID: u.ID},
&user_model.Setting{UserID: u.ID},
+ &pull_model.AutoMerge{DoerID: u.ID},
+ &pull_model.ReviewState{UserID: u.ID},
); err != nil {
return fmt.Errorf("deleteBeans: %v", err)
}