summaryrefslogtreecommitdiffstats
path: root/services/migrations
diff options
context:
space:
mode:
authorJakobDev <jakobdev@gmx.de>2023-10-14 10:37:24 +0200
committerGitHub <noreply@github.com>2023-10-14 08:37:24 +0000
commit76a85a4ce90fead1eb2b743a42b41617b4592889 (patch)
treeef172bbbc48c24e0d95cd5c689426bad16205a69 /services/migrations
parentae419fa49403537725c806a5f3f1e5b274f52eb7 (diff)
downloadgitea-76a85a4ce90fead1eb2b743a42b41617b4592889.tar.gz
gitea-76a85a4ce90fead1eb2b743a42b41617b4592889.zip
Final round of `db.DefaultContext` refactor (#27587)
Last part of #27065
Diffstat (limited to 'services/migrations')
-rw-r--r--services/migrations/gitea_uploader.go2
-rw-r--r--services/migrations/gitea_uploader_test.go2
-rw-r--r--services/migrations/update.go2
3 files changed, 3 insertions, 3 deletions
diff --git a/services/migrations/gitea_uploader.go b/services/migrations/gitea_uploader.go
index 36b5e15298..ddc2cbd4ec 100644
--- a/services/migrations/gitea_uploader.go
+++ b/services/migrations/gitea_uploader.go
@@ -989,7 +989,7 @@ func (g *GiteaLocalUploader) remapLocalUser(source user_model.ExternalUserMigrat
func (g *GiteaLocalUploader) remapExternalUser(source user_model.ExternalUserMigrated, target user_model.ExternalUserRemappable) (userid int64, err error) {
userid, ok := g.userMap[source.GetExternalID()]
if !ok {
- userid, err = user_model.GetUserIDByExternalUserID(g.gitServiceType.Name(), fmt.Sprintf("%d", source.GetExternalID()))
+ userid, err = user_model.GetUserIDByExternalUserID(g.ctx, g.gitServiceType.Name(), fmt.Sprintf("%d", source.GetExternalID()))
if err != nil {
log.Error("GetUserIDByExternalUserID: %v", err)
return 0, err
diff --git a/services/migrations/gitea_uploader_test.go b/services/migrations/gitea_uploader_test.go
index 847e76d9b1..84db83bc67 100644
--- a/services/migrations/gitea_uploader_test.go
+++ b/services/migrations/gitea_uploader_test.go
@@ -210,7 +210,7 @@ func TestGiteaUploadRemapExternalUser(t *testing.T) {
LoginSourceID: 0,
Provider: structs.GiteaService.Name(),
}
- err = user_model.LinkExternalToUser(linkedUser, externalLoginUser)
+ err = user_model.LinkExternalToUser(db.DefaultContext, linkedUser, externalLoginUser)
assert.NoError(t, err)
//
diff --git a/services/migrations/update.go b/services/migrations/update.go
index f14c07cc80..d466832363 100644
--- a/services/migrations/update.go
+++ b/services/migrations/update.go
@@ -45,7 +45,7 @@ func updateMigrationPosterIDByGitService(ctx context.Context, tp structs.GitServ
default:
}
- users, err := user_model.FindExternalUsersByProvider(user_model.FindExternalUserOptions{
+ users, err := user_model.FindExternalUsersByProvider(ctx, user_model.FindExternalUserOptions{
Provider: provider,
Start: start,
Limit: batchSize,