mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-05 03:58:28 +02:00
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>
This commit is contained in:
1 parent
b06b9a056c
commit
76aa33d884
15 files changed
+259
-269
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user