mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-06-18 18:58:22 +08:00
Move almost all functions' parameter db.Engine to context.Context (#19748)
* Move almost all functions' parameter db.Engine to context.Context * remove some unnecessary wrap functions
This commit is contained in:
cmd
integrations
api_issue_tracked_time_test.goapi_repo_test.goauth_ldap_test.gogit_test.gomirror_pull_test.gopull_merge_test.gopull_update_test.go
models
action.goaction_list.go
asymkey
gpg_key.gogpg_key_add.gossh_key.gossh_key_authorized_keys.gossh_key_authorized_principals.gossh_key_deploy.gossh_key_fingerprint.gossh_key_principals.go
auth
branches.gocommit_status.goconsistency.godb
issue.goissue_assignees.goissue_assignees_test.goissue_comment.goissue_comment_list.goissue_dependency.goissue_label.goissue_label_test.goissue_list.goissue_project.goissue_stopwatch.goissue_stopwatch_test.goissue_test.goissue_tracked_time.goissue_tracked_time_test.goissue_watch.goissue_watch_test.goissue_xref.goissue_xref_test.goissues
notification.gonotification_test.goorg.goorg_team.goorganization
perm/access
project
pull.gopull_list.gopull_test.gorelease.gorepo.gorepo
attachment.goattachment_test.goavatar.gocollaboration.gofork.golanguage_stats.gomirror.gopushmirror.gorepo.gorepo_indexer.gorepo_list.gorepo_test.gorepo_unit.gostar.gostar_test.gotopic.goupdate.gouser_repo.gowatch.gowatch_test.go
repo_collaboration.gorepo_generate.gorepo_list.gorepo_test.gorepo_transfer.goreview.goreview_test.gostatistic.gotask.gouser.gouser
webhook
modules
context
convert
doctor
gitgraph
indexer
ssh
routers
api/v1
admin
api.gonotify
org
repo
branch.gocollaborators.gohook.goissue.goissue_comment.goissue_label.goissue_reaction.goissue_subscription.goissue_tracked_time.golabel.golanguage.gomigrate.gomirror.gopull.gopull_review.gorelease_attachment.gorepo.gostatus.goteams.gotransfer.go
user
install
private
web
services
asymkey
attachment
auth
automerge
comments
context
cron
issue
mailer
migrations
mirror
org
pull
release
repository
user
webhook
@ -44,7 +44,7 @@ func DeleteUser(u *user_model.User) error {
|
||||
// cannot perform delete operation.
|
||||
|
||||
// Check ownership of repository.
|
||||
count, err := repo_model.GetRepositoryCount(ctx, u.ID)
|
||||
count, err := repo_model.CountRepositories(ctx, repo_model.CountRepositoryOptions{OwnerID: u.ID})
|
||||
if err != nil {
|
||||
return fmt.Errorf("GetRepositoryCount: %v", err)
|
||||
} else if count > 0 {
|
||||
@ -78,7 +78,7 @@ func DeleteUser(u *user_model.User) error {
|
||||
if err = asymkey_model.RewriteAllPublicKeys(); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = asymkey_model.RewriteAllPrincipalKeys(); err != nil {
|
||||
if err = asymkey_model.RewriteAllPrincipalKeys(db.DefaultContext); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user