summaryrefslogtreecommitdiffstats
path: root/routers/web/repo/release.go
diff options
context:
space:
mode:
authorZettat123 <zettat123@gmail.com>2023-04-07 09:44:52 +0800
committerGitHub <noreply@github.com>2023-04-06 21:44:52 -0400
commited7245f997e980fe5daa9e0d298539bc5e62ac59 (patch)
treedc562e85997c59b645ce31aa6b4b0487c5944bf8 /routers/web/repo/release.go
parent950c93a66a684a84767e9e22a19953d1fc9b43b9 (diff)
downloadgitea-ed7245f997e980fe5daa9e0d298539bc5e62ac59.tar.gz
gitea-ed7245f997e980fe5daa9e0d298539bc5e62ac59.zip
Title can be empty when creating tag only (#23917)
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)
Diffstat (limited to 'routers/web/repo/release.go')
-rw-r--r--routers/web/repo/release.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/routers/web/repo/release.go b/routers/web/repo/release.go
index 5083056ebb..14ef1372c0 100644
--- a/routers/web/repo/release.go
+++ b/routers/web/repo/release.go
@@ -360,6 +360,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