mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 02:38:35 +00:00
[API] Fix inconsistent label color format (#10129)
* update and use labelColorPattern * add TestCases * fix lint * # optional for templates * fix typo * some more * fix lint of **master**
This commit is contained in:
@@ -58,15 +58,15 @@ func CreateRepository(doer, u *models.User, opts models.CreateRepoOptions) (_ *m
|
||||
|
||||
// Initialize Issue Labels if selected
|
||||
if len(opts.IssueLabels) > 0 {
|
||||
if err = models.InitalizeLabels(ctx, repo.ID, opts.IssueLabels); err != nil {
|
||||
return fmt.Errorf("initalizeLabels: %v", err)
|
||||
if err = models.InitializeLabels(ctx, repo.ID, opts.IssueLabels); err != nil {
|
||||
return fmt.Errorf("InitializeLabels: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
if stdout, err := git.NewCommand("update-server-info").
|
||||
SetDescription(fmt.Sprintf("CreateRepository(git update-server-info): %s", repoPath)).
|
||||
RunInDir(repoPath); err != nil {
|
||||
log.Error("CreateRepitory(git update-server-info) in %v: Stdout: %s\nError: %v", repo, stdout, err)
|
||||
log.Error("CreateRepository(git update-server-info) in %v: Stdout: %s\nError: %v", repo, stdout, err)
|
||||
return fmt.Errorf("CreateRepository(git update-server-info): %v", err)
|
||||
}
|
||||
}
|
||||
|
@@ -22,7 +22,7 @@ type CreateLabelOption struct {
|
||||
Name string `json:"name" binding:"Required"`
|
||||
// required:true
|
||||
// example: #00aabb
|
||||
Color string `json:"color" binding:"Required;Size(7)"`
|
||||
Color string `json:"color" binding:"Required"`
|
||||
Description string `json:"description"`
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user