|
9 | 9 |
|
10 | 10 | "code.gitea.io/gitea/models"
|
11 | 11 | "code.gitea.io/gitea/modules/context"
|
| 12 | + "code.gitea.io/gitea/modules/log" |
12 | 13 | "code.gitea.io/gitea/modules/setting"
|
13 | 14 | api "code.gitea.io/gitea/modules/structs"
|
14 | 15 | "code.gitea.io/gitea/modules/upload"
|
@@ -55,6 +56,7 @@ func GetReleaseAttachment(ctx *context.APIContext) {
|
55 | 56 | return
|
56 | 57 | }
|
57 | 58 | if attach.ReleaseID != releaseID {
|
| 59 | + log.Info("User requested attachment is not in release, release_id %v, attachment_id: %v", releaseID, attachID) |
58 | 60 | ctx.NotFound()
|
59 | 61 | return
|
60 | 62 | }
|
@@ -242,13 +244,14 @@ func EditReleaseAttachment(ctx *context.APIContext, form api.EditAttachmentOptio
|
242 | 244 |
|
243 | 245 | // Check if release exists an load release
|
244 | 246 | releaseID := ctx.ParamsInt64(":id")
|
245 |
| - attachID := ctx.ParamsInt64(":attachment") |
| 247 | + attachID := ctx.ParamsInt64(":asset") |
246 | 248 | attach, err := models.GetAttachmentByID(attachID)
|
247 | 249 | if err != nil {
|
248 | 250 | ctx.Error(500, "GetAttachmentByID", err)
|
249 | 251 | return
|
250 | 252 | }
|
251 | 253 | if attach.ReleaseID != releaseID {
|
| 254 | + log.Info("User requested attachment is not in release, release_id %v, attachment_id: %v", releaseID, attachID) |
252 | 255 | ctx.NotFound()
|
253 | 256 | return
|
254 | 257 | }
|
@@ -299,13 +302,14 @@ func DeleteReleaseAttachment(ctx *context.APIContext) {
|
299 | 302 |
|
300 | 303 | // Check if release exists an load release
|
301 | 304 | releaseID := ctx.ParamsInt64(":id")
|
302 |
| - attachID := ctx.ParamsInt64(":attachment") |
| 305 | + attachID := ctx.ParamsInt64(":asset") |
303 | 306 | attach, err := models.GetAttachmentByID(attachID)
|
304 | 307 | if err != nil {
|
305 | 308 | ctx.Error(500, "GetAttachmentByID", err)
|
306 | 309 | return
|
307 | 310 | }
|
308 | 311 | if attach.ReleaseID != releaseID {
|
| 312 | + log.Info("User requested attachment is not in release, release_id %v, attachment_id: %v", releaseID, attachID) |
309 | 313 | ctx.NotFound()
|
310 | 314 | return
|
311 | 315 | }
|
|
0 commit comments