File tree Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -2128,13 +2128,6 @@ func UpdateCommentContent(ctx *context.Context) {
2128
2128
return
2129
2129
}
2130
2130
2131
- if comment .Type == models .CommentTypeComment {
2132
- if err := comment .LoadAttachments (); err != nil {
2133
- ctx .ServerError ("LoadAttachments" , err )
2134
- return
2135
- }
2136
- }
2137
-
2138
2131
if ! ctx .IsSigned || (ctx .User .ID != comment .PosterID && ! ctx .Repo .CanWriteIssuesOrPulls (comment .Issue .IsPull )) {
2139
2132
ctx .Error (http .StatusForbidden )
2140
2133
return
@@ -2156,8 +2149,18 @@ func UpdateCommentContent(ctx *context.Context) {
2156
2149
return
2157
2150
}
2158
2151
2159
- files := ctx .QueryStrings ("files[]" )
2160
- if err := updateAttachments (comment , files ); err != nil {
2152
+ if ctx .QueryBool ("ignore_attachments" ) {
2153
+ return
2154
+ }
2155
+
2156
+ if comment .Type == models .CommentTypeComment {
2157
+ if err := comment .LoadAttachments (); err != nil {
2158
+ ctx .ServerError ("LoadAttachments" , err )
2159
+ return
2160
+ }
2161
+ }
2162
+
2163
+ if err := updateAttachments (comment , ctx .QueryStrings ("files[]" )); err != nil {
2161
2164
ctx .ServerError ("UpdateAttachments" , err )
2162
2165
return
2163
2166
}
Original file line number Diff line number Diff line change @@ -46,9 +46,10 @@ export function initMarkupTasklist() {
46
46
const { updateUrl, context} = editContentZone . dataset ;
47
47
48
48
await $ . post ( updateUrl , {
49
+ ignore_attachments : true ,
49
50
_csrf : window . config . csrf ,
50
51
content : newContent ,
51
- context,
52
+ context
52
53
} ) ;
53
54
54
55
rawContent . textContent = newContent ;
You can’t perform that action at this time.
0 commit comments