mirror of
https://github.com/go-gitea/gitea
synced 2024-08-24 19:22:25 +02:00
Merge pull request #322 from nuss-justin/issue/321
Fix #321. Allow empty comments as long as there are attachments.
This commit is contained in:
commit
204ef41b09
|
@ -755,7 +755,8 @@ func Comment(ctx *middleware.Context, params martini.Params) {
|
|||
|
||||
var ms []string
|
||||
content := ctx.Query("content")
|
||||
if len(content) > 0 {
|
||||
// Fix #321. Allow empty comments, as long as we have attachments.
|
||||
if len(content) > 0 || len(ctx.Req.MultipartForm.File["attachments"]) > 0 {
|
||||
switch params["action"] {
|
||||
case "new":
|
||||
if comment, err = models.CreateComment(ctx.User.Id, ctx.Repo.Repository.Id, issue.Id, 0, 0, models.COMMENT, content, nil); err != nil {
|
||||
|
|
|
@ -72,7 +72,11 @@
|
|||
<span class="role label label-default pull-right">Owner</span>
|
||||
</div>
|
||||
<div class="panel-body markdown">
|
||||
{{if len .Content}}
|
||||
{{str2html .Content}}
|
||||
{{else}}
|
||||
<i>No comment entered</i>
|
||||
{{end}}
|
||||
</div>
|
||||
{{with $attachments := .Attachments}}
|
||||
{{if $attachments}}
|
||||
|
|
Loading…
Reference in a new issue