mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-25 11:22:16 +00:00
Add auto-detect home directory
This commit is contained in:
parent
9047cadcd3
commit
a55941ff83
5 changed files with 25 additions and 18 deletions
|
@ -231,6 +231,12 @@ func Comment(ctx *middleware.Context, params martini.Params) {
|
|||
return
|
||||
}
|
||||
|
||||
content := ctx.Query("content")
|
||||
if len(content) == 0 {
|
||||
ctx.Redirect(fmt.Sprintf("/%s/%s/issues/%d", ctx.User.Name, ctx.Repo.Repository.Name, index))
|
||||
return
|
||||
}
|
||||
|
||||
issue, err := models.GetIssueByIndex(ctx.Repo.Repository.Id, int64(index))
|
||||
if err != nil {
|
||||
if err == models.ErrIssueNotExist {
|
||||
|
@ -241,12 +247,6 @@ func Comment(ctx *middleware.Context, params martini.Params) {
|
|||
return
|
||||
}
|
||||
|
||||
content := ctx.Query("content")
|
||||
if len(content) == 0 {
|
||||
ctx.Handle(404, "issue.Comment", err)
|
||||
return
|
||||
}
|
||||
|
||||
switch params["action"] {
|
||||
case "new":
|
||||
if err = models.CreateComment(ctx.User.Id, issue.Id, 0, 0, content); err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue