1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-09 02:58:20 +00:00

Title can be empty when creating tag only (#23917) (#23961)

Backport #23917 by @Zettat123

Fixes #23809

Make the title not required. If the title is empty when creating release
(not tag), an error message will be displayed.

![image](https://user-images.githubusercontent.com/15528715/229761056-c52e338b-5f25-4d7d-bb44-2cb0304abcee.png)

Co-authored-by: Zettat123 <zettat123@gmail.com>
This commit is contained in:
Giteabot
2023-04-07 08:13:57 -04:00
committed by GitHub
parent 085b56302c
commit 1b8ecd179b
4 changed files with 9 additions and 2 deletions

View File

@@ -357,6 +357,12 @@ func NewReleasePost(ctx *context.Context) {
return
}
// Title of release cannot be empty
if len(form.TagOnly) == 0 && len(form.Title) == 0 {
ctx.RenderWithErr(ctx.Tr("repo.release.title_empty"), tplReleaseNew, &form)
return
}
var attachmentUUIDs []string
if setting.Attachment.Enabled {
attachmentUUIDs = form.Files