mirror of
https://github.com/go-gitea/gitea.git
synced 2025-06-21 21:48:00 +02:00
Add auto-detect home directory
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user