Skip to content

Commit e54cb9a

Browse files
committed
load shared data on edit (without it, tags list was empty on release edit)
1 parent dfabc17 commit e54cb9a

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

routers/web/repo/release.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -551,11 +551,13 @@ func NewReleasePost(ctx *context.Context) {
551551

552552
// EditRelease render release edit page
553553
func EditRelease(ctx *context.Context) {
554+
newReleaseCommon(ctx)
555+
if ctx.Written() {
556+
return
557+
}
558+
554559
ctx.Data["Title"] = ctx.Tr("repo.release.edit_release")
555-
ctx.Data["PageIsReleaseList"] = true
556560
ctx.Data["PageIsEditRelease"] = true
557-
ctx.Data["IsAttachmentEnabled"] = setting.Attachment.Enabled
558-
upload.AddUploadContext(ctx, "release")
559561

560562
tagName := ctx.PathParam("*")
561563
rel, err := repo_model.GetRelease(ctx, ctx.Repo.Repository.ID, tagName)
@@ -596,8 +598,13 @@ func EditRelease(ctx *context.Context) {
596598
// EditReleasePost response for edit release
597599
func EditReleasePost(ctx *context.Context) {
598600
form := web.GetForm(ctx).(*forms.EditReleaseForm)
601+
602+
newReleaseCommon(ctx)
603+
if ctx.Written() {
604+
return
605+
}
606+
599607
ctx.Data["Title"] = ctx.Tr("repo.release.edit_release")
600-
ctx.Data["PageIsReleaseList"] = true
601608
ctx.Data["PageIsEditRelease"] = true
602609

603610
tagName := ctx.PathParam("*")

0 commit comments

Comments
 (0)