File tree Expand file tree Collapse file tree 4 files changed +9
-2
lines changed Expand file tree Collapse file tree 4 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -2308,6 +2308,7 @@ release.tag_helper = Choose an existing tag or create a new tag.
2308
2308
release.tag_helper_new = New tag. This tag will be created from the target.
2309
2309
release.tag_helper_existing = Existing tag.
2310
2310
release.title = Title
2311
+ release.title_empty = Title cannot be empty.
2311
2312
release.content = Content
2312
2313
release.prerelease_desc = Mark as Pre-Release
2313
2314
release.prerelease_helper = Mark this release unsuitable for production use.
Original file line number Diff line number Diff line change @@ -360,6 +360,12 @@ func NewReleasePost(ctx *context.Context) {
360
360
return
361
361
}
362
362
363
+ // Title of release cannot be empty
364
+ if len (form .TagOnly ) == 0 && len (form .Title ) == 0 {
365
+ ctx .RenderWithErr (ctx .Tr ("repo.release.title_empty" ), tplReleaseNew , & form )
366
+ return
367
+ }
368
+
363
369
var attachmentUUIDs []string
364
370
if setting .Attachment .Enabled {
365
371
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 47
47
<div class="eleven wide column">
48
48
<div class="field {{if .Err_Title}}error{{end}}">
49
49
<label>{{.locale.Tr "repo.release.title"}}</label>
50
- <input name="title" placeholder="{{.locale.Tr "repo.release.title"}}" value="{{.title}}" autofocus required maxlength="255">
50
+ <input name="title" placeholder="{{.locale.Tr "repo.release.title"}}" value="{{.title}}" autofocus maxlength="255">
51
51
</div>
52
52
<div class="field">
53
53
<label>{{.locale.Tr "repo.release.content"}}</label>
You can’t perform that action at this time.
0 commit comments