Allow downloading attachments of draft releases (#31369) (#31380)

Backport #31369 by Zettat123

Fix #31362

Co-authored-by: Zettat123 <zettat123@gmail.com>
pull/31393/head
Giteabot 5 months ago committed by GitHub
parent 52925e9c7c
commit 3f44844244
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      routers/web/repo/repo.go

@ -418,8 +418,9 @@ func RedirectDownload(ctx *context.Context) {
tagNames := []string{vTag} tagNames := []string{vTag}
curRepo := ctx.Repo.Repository curRepo := ctx.Repo.Repository
releases, err := db.Find[repo_model.Release](ctx, repo_model.FindReleasesOptions{ releases, err := db.Find[repo_model.Release](ctx, repo_model.FindReleasesOptions{
RepoID: curRepo.ID, IncludeDrafts: ctx.Repo.CanWrite(unit.TypeReleases),
TagNames: tagNames, RepoID: curRepo.ID,
TagNames: tagNames,
}) })
if err != nil { if err != nil {
ctx.ServerError("RedirectDownload", err) ctx.ServerError("RedirectDownload", err)

Loading…
Cancel
Save