File tree 4 files changed +9
-2
lines changed
4 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -2288,6 +2288,7 @@ release.tag_name = Tag name
2288
2288
release.target = Target
2289
2289
release.tag_helper = Choose an existing tag or create a new tag.
2290
2290
release.title = Title
2291
+ release.title_empty = Title cannot be empty.
2291
2292
release.content = Content
2292
2293
release.prerelease_desc = Mark as Pre-Release
2293
2294
release.prerelease_helper = Mark this release unsuitable for production use.
Original file line number Diff line number Diff line change @@ -357,6 +357,12 @@ func NewReleasePost(ctx *context.Context) {
357
357
return
358
358
}
359
359
360
+ // Title of release cannot be empty
361
+ if len (form .TagOnly ) == 0 && len (form .Title ) == 0 {
362
+ ctx .RenderWithErr (ctx .Tr ("repo.release.title_empty" ), tplReleaseNew , & form )
363
+ return
364
+ }
365
+
360
366
var attachmentUUIDs []string
361
367
if setting .Attachment .Enabled {
362
368
attachmentUUIDs = form .Files
Original file line number Diff line number Diff line change @@ -693,7 +693,7 @@ type UpdateAllowEditsForm struct {
693
693
type NewReleaseForm struct {
694
694
TagName string `binding:"Required;GitRefName;MaxSize(255)"`
695
695
Target string `form:"tag_target" binding:"Required;MaxSize(255)"`
696
- Title string `binding:"Required; MaxSize(255)"`
696
+ Title string `binding:"MaxSize(255)"`
697
697
Content string
698
698
Draft string
699
699
TagOnly string
Original file line number Diff line number Diff line change 42
42
<div class="eleven wide column">
43
43
<div class="field {{if .Err_Title}}error{{end}}">
44
44
<label>{{.locale.Tr "repo.release.title"}}</label>
45
- <input name="title" placeholder="{{.locale.Tr "repo.release.title"}}" value="{{.title}}" autofocus required maxlength="255">
45
+ <input name="title" placeholder="{{.locale.Tr "repo.release.title"}}" value="{{.title}}" autofocus maxlength="255">
46
46
</div>
47
47
<div class="field content-editor">
48
48
<label>{{.locale.Tr "repo.release.content"}}</label>
You can’t perform that action at this time.
0 commit comments