File tree 2 files changed +13
-8
lines changed
2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -2127,13 +2127,6 @@ func UpdateCommentContent(ctx *context.Context) {
2127
2127
return
2128
2128
}
2129
2129
2130
- if comment .Type == models .CommentTypeComment {
2131
- if err := comment .LoadAttachments (); err != nil {
2132
- ctx .ServerError ("LoadAttachments" , err )
2133
- return
2134
- }
2135
- }
2136
-
2137
2130
if ! ctx .IsSigned || (ctx .User .ID != comment .PosterID && ! ctx .Repo .CanWriteIssuesOrPulls (comment .Issue .IsPull )) {
2138
2131
ctx .Error (http .StatusForbidden )
2139
2132
return
@@ -2155,6 +2148,17 @@ func UpdateCommentContent(ctx *context.Context) {
2155
2148
return
2156
2149
}
2157
2150
2151
+ if ctx .FormBool ("ignore_attachments" ) {
2152
+ return
2153
+ }
2154
+
2155
+ if comment .Type == models .CommentTypeComment {
2156
+ if err := comment .LoadAttachments (); err != nil {
2157
+ ctx .ServerError ("LoadAttachments" , err )
2158
+ return
2159
+ }
2160
+ }
2161
+
2158
2162
if err := updateAttachments (comment , ctx .FormStrings ("files[]" )); err != nil {
2159
2163
ctx .ServerError ("UpdateAttachments" , err )
2160
2164
return
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