summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-02-09 15:33:03 +0100
committerGitHub <noreply@github.com>2020-02-09 14:33:03 +0000
commite273817154e98b7b675e43e97cd17f48a603cf9e (patch)
tree9f350c301a87d3dd57b4bdad954cf1c44185cb1a /modules
parent74a4a1e17f99d147db9329718a5ecc87984b0ecd (diff)
downloadgitea-e273817154e98b7b675e43e97cd17f48a603cf9e.tar.gz
gitea-e273817154e98b7b675e43e97cd17f48a603cf9e.zip
[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**
Diffstat (limited to 'modules')
-rw-r--r--modules/repository/create.go6
-rw-r--r--modules/structs/issue_label.go2
2 files changed, 4 insertions, 4 deletions
diff --git a/modules/repository/create.go b/modules/repository/create.go
index dc96b856d9..255bf09731 100644
--- a/modules/repository/create.go
+++ b/modules/repository/create.go
@@ -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)
}
}
diff --git a/modules/structs/issue_label.go b/modules/structs/issue_label.go
index 0789624ab1..2aadd8638e 100644
--- a/modules/structs/issue_label.go
+++ b/modules/structs/issue_label.go
@@ -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"`
}