1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Delete repos of org when purge delete user (#27273) (#27728)

Fixes https://codeberg.org/forgejo/forgejo/issues/1514

Backports #27273

---------

Co-authored-by: JakobDev <jakobdev@gmx.de>
This commit is contained in:
6543
2023-11-01 03:03:12 +01:00
committed by GitHub
parent 6ac2ade97d
commit 6637bbf510
14 changed files with 79 additions and 51 deletions

View File

@@ -716,7 +716,7 @@ func FindUserCodeAccessibleOwnerRepoIDs(ctx context.Context, ownerID int64, user
}
// GetUserRepositories returns a list of repositories of given user.
func GetUserRepositories(opts *SearchRepoOptions) (RepositoryList, int64, error) {
func GetUserRepositories(ctx context.Context, opts *SearchRepoOptions) (RepositoryList, int64, error) {
if len(opts.OrderBy) == 0 {
opts.OrderBy = "updated_unix DESC"
}
@@ -734,7 +734,7 @@ func GetUserRepositories(opts *SearchRepoOptions) (RepositoryList, int64, error)
cond = cond.And(builder.In("lower_name", opts.LowerNames))
}
sess := db.GetEngine(db.DefaultContext)
sess := db.GetEngine(ctx)
count, err := sess.Where(cond).Count(new(Repository))
if err != nil {