From 76aa33d884af283619054ed14a6137efc14b6d35 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 29 Mar 2022 15:23:45 +0800 Subject: Move init repository related functions to modules (#19159) * Move init repository related functions to modules * Fix lint * Use ctx but db.DefaultContext Co-authored-by: wxiaoguang --- modules/repository/create.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/repository/create.go') diff --git a/modules/repository/create.go b/modules/repository/create.go index 6409cc55ce..d63f501ec4 100644 --- a/modules/repository/create.go +++ b/modules/repository/create.go @@ -33,7 +33,7 @@ func CreateRepository(doer, u *user_model.User, opts models.CreateRepoOptions) ( // Check if label template exist if len(opts.IssueLabels) > 0 { - if _, err := models.GetLabelTemplateFile(opts.IssueLabels); err != nil { + if _, err := GetLabelTemplateFile(opts.IssueLabels); err != nil { return nil, err } } @@ -100,7 +100,7 @@ func CreateRepository(doer, u *user_model.User, opts models.CreateRepoOptions) ( // Initialize Issue Labels if selected if len(opts.IssueLabels) > 0 { - if err = models.InitializeLabels(ctx, repo.ID, opts.IssueLabels, false); err != nil { + if err = InitializeLabels(ctx, repo.ID, opts.IssueLabels, false); err != nil { rollbackRepo = repo rollbackRepo.OwnerID = u.ID return fmt.Errorf("InitializeLabels: %v", err) -- cgit v1.2.3