diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2021-08-20 21:26:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-20 15:26:19 -0400 |
commit | dc2613600cc5a2a0e1418762a779cd89f18dd30e (patch) | |
tree | ff2824d5ed80b20bb3afb4e5090ae2a455c817c6 /routers | |
parent | 3b2ed4762e1f8e5b4e2b7f0c03b90d9fbcde5c19 (diff) | |
download | gitea-dc2613600cc5a2a0e1418762a779cd89f18dd30e.tar.gz gitea-dc2613600cc5a2a0e1418762a779cd89f18dd30e.zip |
Keep attachments on tasklist update (#16750)
* Send attachments too.
* Use tasklist flag.
* use action="ignoreAttachments" instead of "tasklist"
* Use boolean parameter.
Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'routers')
-rw-r--r-- | routers/web/repo/issue.go | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go index ff83be4410..56561c6168 100644 --- a/routers/web/repo/issue.go +++ b/routers/web/repo/issue.go @@ -2127,13 +2127,6 @@ func UpdateCommentContent(ctx *context.Context) { return } - if comment.Type == models.CommentTypeComment { - if err := comment.LoadAttachments(); err != nil { - ctx.ServerError("LoadAttachments", err) - return - } - } - if !ctx.IsSigned || (ctx.User.ID != comment.PosterID && !ctx.Repo.CanWriteIssuesOrPulls(comment.Issue.IsPull)) { ctx.Error(http.StatusForbidden) return @@ -2155,6 +2148,17 @@ func UpdateCommentContent(ctx *context.Context) { return } + if ctx.FormBool("ignore_attachments") { + return + } + + if comment.Type == models.CommentTypeComment { + if err := comment.LoadAttachments(); err != nil { + ctx.ServerError("LoadAttachments", err) + return + } + } + if err := updateAttachments(comment, ctx.FormStrings("files[]")); err != nil { ctx.ServerError("UpdateAttachments", err) return |