Skip to content

Commit 491407d

Browse files
committed
gogs#3590 fix 404 for release draft edition
Closes gogs#3591
1 parent 6da5515 commit 491407d

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Gogs - Go Git Service [![Build Status](https://travis-ci.org/gogits/gogs.svg?bra
33

44
![](https://github.com/gogits/gogs/blob/master/public/img/gogs-large-resize.png?raw=true)
55

6-
##### Current tip version: 0.9.98 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions)
6+
##### Current tip version: 0.9.99 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions)
77

88
| Web | UI | Preview |
99
|:-------------:|:-------:|:-------:|

cmd/web.go

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,11 +497,27 @@ func runWeb(ctx *cli.Context) error {
497497
m.Group("/releases", func() {
498498
m.Get("/new", repo.NewRelease)
499499
m.Post("/new", bindIgnErr(auth.NewReleaseForm{}), repo.NewReleasePost)
500-
m.Get("/edit/*", repo.EditRelease)
501-
m.Post("/edit/*", bindIgnErr(auth.EditReleaseForm{}), repo.EditReleasePost)
502500
m.Post("/delete", repo.DeleteRelease)
503501
}, reqRepoWriter, context.RepoRef())
504502

503+
m.Group("/releases", func() {
504+
m.Get("/edit/*", repo.EditRelease)
505+
m.Post("/edit/*", bindIgnErr(auth.EditReleaseForm{}), repo.EditReleasePost)
506+
}, reqRepoWriter, func(ctx *context.Context) {
507+
var err error
508+
ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetBranchCommit(ctx.Repo.Repository.DefaultBranch)
509+
if err != nil {
510+
ctx.Handle(500, "GetBranchCommit", err)
511+
return
512+
}
513+
ctx.Repo.CommitsCount, err = ctx.Repo.Commit.CommitsCount()
514+
if err != nil {
515+
ctx.Handle(500, "CommitsCount", err)
516+
return
517+
}
518+
ctx.Data["CommitsCount"] = ctx.Repo.CommitsCount
519+
})
520+
505521
m.Combo("/compare/*", repo.MustAllowPulls).Get(repo.CompareAndPullRequest).
506522
Post(bindIgnErr(auth.CreateIssueForm{}), repo.CompareAndPullRequestPost)
507523

gogs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"github.com/gogits/gogs/modules/setting"
1818
)
1919

20-
const APP_VER = "0.9.98.0902"
20+
const APP_VER = "0.9.99.0903"
2121

2222
func init() {
2323
runtime.GOMAXPROCS(runtime.NumCPU())

templates/.VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.9.98.0902
1+
0.9.99.0903

0 commit comments

Comments
 (0)