mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Unit tests for routers/repo/issue_label (#3198)
This commit is contained in:
@@ -155,18 +155,14 @@ func UpdateIssueLabel(ctx *context.Context) {
|
||||
}
|
||||
|
||||
if action == "toggle" {
|
||||
anyHaveLabel := false
|
||||
// detach if any issues already have label, otherwise attach
|
||||
action = "attach"
|
||||
for _, issue := range issues {
|
||||
if issue.HasLabel(label.ID) {
|
||||
anyHaveLabel = true
|
||||
action = "detach"
|
||||
break
|
||||
}
|
||||
}
|
||||
if anyHaveLabel {
|
||||
action = "detach"
|
||||
} else {
|
||||
action = "attach"
|
||||
}
|
||||
}
|
||||
|
||||
if action == "attach" {
|
||||
|
Reference in New Issue
Block a user