summaryrefslogtreecommitdiffstats
path: root/routers/web
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2024-06-16 20:55:14 +0800
committerGitHub <noreply@github.com>2024-06-16 20:55:14 +0800
commit3f44844244dd5e6329bbfaf29a3d5b4b244ab84f (patch)
tree0e7629cded58d046a00df3cad55e8b8f11af9836 /routers/web
parent52925e9c7c22163ea66729ebfc091292e8a22eee (diff)
downloadgitea-3f44844244dd5e6329bbfaf29a3d5b4b244ab84f.tar.gz
gitea-3f44844244dd5e6329bbfaf29a3d5b4b244ab84f.zip
Allow downloading attachments of draft releases (#31369) (#31380)
Backport #31369 by Zettat123 Fix #31362 Co-authored-by: Zettat123 <zettat123@gmail.com>
Diffstat (limited to 'routers/web')
-rw-r--r--routers/web/repo/repo.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/routers/web/repo/repo.go b/routers/web/repo/repo.go
index f54b35c3e0..c1eda8b674 100644
--- a/routers/web/repo/repo.go
+++ b/routers/web/repo/repo.go
@@ -418,8 +418,9 @@ func RedirectDownload(ctx *context.Context) {
tagNames := []string{vTag}
curRepo := ctx.Repo.Repository
releases, err := db.Find[repo_model.Release](ctx, repo_model.FindReleasesOptions{
- RepoID: curRepo.ID,
- TagNames: tagNames,
+ IncludeDrafts: ctx.Repo.CanWrite(unit.TypeReleases),
+ RepoID: curRepo.ID,
+ TagNames: tagNames,
})
if err != nil {
ctx.ServerError("RedirectDownload", err)