aboutsummaryrefslogtreecommitdiffstats
path: root/models/user.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/user.go')
-rw-r--r--models/user.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/models/user.go b/models/user.go
index 59ec643d55..49374014aa 100644
--- a/models/user.go
+++ b/models/user.go
@@ -16,7 +16,7 @@ import (
auth_model "code.gitea.io/gitea/models/auth"
"code.gitea.io/gitea/models/db"
git_model "code.gitea.io/gitea/models/git"
- "code.gitea.io/gitea/models/issues"
+ issues_model "code.gitea.io/gitea/models/issues"
"code.gitea.io/gitea/models/organization"
access_model "code.gitea.io/gitea/models/perm/access"
pull_model "code.gitea.io/gitea/models/pull"
@@ -78,12 +78,12 @@ func DeleteUser(ctx context.Context, u *user_model.User) (err error) {
&user_model.Follow{UserID: u.ID},
&user_model.Follow{FollowID: u.ID},
&Action{UserID: u.ID},
- &IssueUser{UID: u.ID},
+ &issues_model.IssueUser{UID: u.ID},
&user_model.EmailAddress{UID: u.ID},
&user_model.UserOpenID{UID: u.ID},
- &issues.Reaction{UserID: u.ID},
+ &issues_model.Reaction{UserID: u.ID},
&organization.TeamUser{UID: u.ID},
- &Stopwatch{UserID: u.ID},
+ &issues_model.Stopwatch{UserID: u.ID},
&user_model.Setting{UserID: u.ID},
&pull_model.AutoMerge{DoerID: u.ID},
&pull_model.ReviewState{UserID: u.ID},
@@ -101,8 +101,8 @@ func DeleteUser(ctx context.Context, u *user_model.User) (err error) {
// Delete Comments
const batchSize = 50
for start := 0; ; start += batchSize {
- comments := make([]*Comment, 0, batchSize)
- if err = e.Where("type=? AND poster_id=?", CommentTypeComment, u.ID).Limit(batchSize, start).Find(&comments); err != nil {
+ comments := make([]*issues_model.Comment, 0, batchSize)
+ if err = e.Where("type=? AND poster_id=?", issues_model.CommentTypeComment, u.ID).Limit(batchSize, start).Find(&comments); err != nil {
return err
}
if len(comments) == 0 {
@@ -110,14 +110,14 @@ func DeleteUser(ctx context.Context, u *user_model.User) (err error) {
}
for _, comment := range comments {
- if err = deleteComment(ctx, comment); err != nil {
+ if err = issues_model.DeleteComment(ctx, comment); err != nil {
return err
}
}
}
// Delete Reactions
- if err = issues.DeleteReaction(ctx, &issues.ReactionOptions{DoerID: u.ID}); err != nil {
+ if err = issues_model.DeleteReaction(ctx, &issues_model.ReactionOptions{DoerID: u.ID}); err != nil {
return err
}
}
@@ -189,7 +189,7 @@ func DeleteUser(ctx context.Context, u *user_model.User) (err error) {
// ***** END: GPGPublicKey *****
// Clear assignee.
- if _, err = db.DeleteByBean(ctx, &IssueAssignees{AssigneeID: u.ID}); err != nil {
+ if _, err = db.DeleteByBean(ctx, &issues_model.IssueAssignees{AssigneeID: u.ID}); err != nil {
return fmt.Errorf("clear assignee: %v", err)
}