mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Validate that the tag doesn't exist when creating a tag via the web (#33241)
Found while investigating #33210. This line no longer makes sense because the form field "TagName" is required, so this would mean that this code path would never be covered. Because it isn't covered, we end up going down the "update release" logic where we eventually set `Release.IsTag` to false (meaning it will now be treated as a release instead of a tag). This snapshot rewrites the condition to ensure that we aren't trying to create a tag that already exists. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -109,23 +109,17 @@
|
||||
{{ctx.Locale.Tr "repo.release.delete_release"}}
|
||||
</a>
|
||||
{{if .IsDraft}}
|
||||
<button class="ui small button" type="submit" name="draft" value="{{ctx.Locale.Tr "repo.release.save_draft"}}">{{ctx.Locale.Tr "repo.release.save_draft"}}</button>
|
||||
<button class="ui small primary button">
|
||||
{{ctx.Locale.Tr "repo.release.publish"}}
|
||||
</button>
|
||||
<button class="ui small button" type="submit" name="draft" value="1">{{ctx.Locale.Tr "repo.release.save_draft"}}</button>
|
||||
<button class="ui small primary button">{{ctx.Locale.Tr "repo.release.publish"}}</button>
|
||||
{{else}}
|
||||
<button class="ui small primary button">
|
||||
{{ctx.Locale.Tr "repo.release.edit_release"}}
|
||||
</button>
|
||||
<button class="ui small primary button">{{ctx.Locale.Tr "repo.release.edit_release"}}</button>
|
||||
{{end}}
|
||||
{{else}}
|
||||
{{if not .tag_name}}
|
||||
{{if .ShowCreateTagOnlyButton}}
|
||||
<button class="ui small button" name="tag_only" value="1">{{ctx.Locale.Tr "repo.release.add_tag"}}</button>
|
||||
{{end}}
|
||||
<button class="ui small button" name="draft" value="1">{{ctx.Locale.Tr "repo.release.save_draft"}}</button>
|
||||
<button class="ui small primary button">
|
||||
{{ctx.Locale.Tr "repo.release.publish"}}
|
||||
</button>
|
||||
<button class="ui small primary button">{{ctx.Locale.Tr "repo.release.publish"}}</button>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user