Skip to content

Commit 42718d3

Browse files
authored
Allow downloading attachments of draft releases (#31369)
Fix #31362
1 parent 84cbb6c commit 42718d3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

routers/web/repo/repo.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,9 @@ func RedirectDownload(ctx *context.Context) {
418418
tagNames := []string{vTag}
419419
curRepo := ctx.Repo.Repository
420420
releases, err := db.Find[repo_model.Release](ctx, repo_model.FindReleasesOptions{
421-
RepoID: curRepo.ID,
422-
TagNames: tagNames,
421+
IncludeDrafts: ctx.Repo.CanWrite(unit.TypeReleases),
422+
RepoID: curRepo.ID,
423+
TagNames: tagNames,
423424
})
424425
if err != nil {
425426
ctx.ServerError("RedirectDownload", err)

0 commit comments

Comments
 (0)