diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2022-03-29 15:23:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-29 15:23:45 +0800 |
commit | 76aa33d884af283619054ed14a6137efc14b6d35 (patch) | |
tree | 238f2bc5add522767df93cd6064ed4037b0d3b1b /modules/repository/create.go | |
parent | b06b9a056c0af751e576978f6ef3c914ee959b9c (diff) | |
download | gitea-76aa33d884af283619054ed14a6137efc14b6d35.tar.gz gitea-76aa33d884af283619054ed14a6137efc14b6d35.zip |
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 <wxiaoguang@gmail.com>
Diffstat (limited to 'modules/repository/create.go')
-rw-r--r-- | modules/repository/create.go | 4 |
1 files changed, 2 insertions, 2 deletions
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) |