aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/repo
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2022-03-29 22:57:33 +0800
committerGitHub <noreply@github.com>2022-03-29 16:57:33 +0200
commit74731c3a5aea71c81e4ca75bde96154f3adf3cfa (patch)
tree64b01935ab9912de71318eac447721e41b200135 /routers/web/repo
parentbd97736b9c7a16023bc9abf17be6157284f655b1 (diff)
downloadgitea-74731c3a5aea71c81e4ca75bde96154f3adf3cfa.tar.gz
gitea-74731c3a5aea71c81e4ca75bde96154f3adf3cfa.zip
Move some issue methods as functions (#19255)
* Move some issue methods as functions * Fix bug
Diffstat (limited to 'routers/web/repo')
-rw-r--r--routers/web/repo/issue.go2
-rw-r--r--routers/web/repo/issue_label.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go
index 5af91c8e5f..c50e773e99 100644
--- a/routers/web/repo/issue.go
+++ b/routers/web/repo/issue.go
@@ -2595,7 +2595,7 @@ func updateAttachments(item interface{}, files []string) error {
if len(files) > 0 {
switch content := item.(type) {
case *models.Issue:
- err = content.UpdateAttachments(files)
+ err = models.UpdateIssueAttachments(content.ID, files)
case *models.Comment:
err = content.UpdateAttachments(files)
default:
diff --git a/routers/web/repo/issue_label.go b/routers/web/repo/issue_label.go
index 289e870bb1..887bbc115f 100644
--- a/routers/web/repo/issue_label.go
+++ b/routers/web/repo/issue_label.go
@@ -191,7 +191,7 @@ func UpdateIssueLabel(ctx *context.Context) {
// detach if any issues already have label, otherwise attach
action = "attach"
for _, issue := range issues {
- if issue.HasLabel(label.ID) {
+ if models.HasIssueLabel(issue.ID, label.ID) {
action = "detach"
break
}