diff options
author | a1012112796 <1012112796@qq.com> | 2022-06-17 04:03:03 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-16 22:03:03 +0200 |
commit | e3e06d13afdd882ca5934fde77217ff9554354c4 (patch) | |
tree | 5f46b0277127af587f1aed139d15b024f9dae74d /routers/web/repo/release.go | |
parent | 89b0aac37449cf7ccdfa52c6edbe537257228bc1 (diff) | |
download | gitea-e3e06d13afdd882ca5934fde77217ff9554354c4.tar.gz gitea-e3e06d13afdd882ca5934fde77217ff9554354c4.zip |
fix permission check for delete tag (#19985)
fix #19970
by the way, fix some error response about protected tags.
Signed-off-by: a1012112796 <1012112796@qq.com>
Diffstat (limited to 'routers/web/repo/release.go')
-rw-r--r-- | routers/web/repo/release.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/routers/web/repo/release.go b/routers/web/repo/release.go index fba3ef7a06..666294631c 100644 --- a/routers/web/repo/release.go +++ b/routers/web/repo/release.go @@ -519,7 +519,11 @@ func DeleteTag(ctx *context.Context) { func deleteReleaseOrTag(ctx *context.Context, isDelTag bool) { if err := releaseservice.DeleteReleaseByID(ctx, ctx.FormInt64("id"), ctx.Doer, isDelTag); err != nil { - ctx.Flash.Error("DeleteReleaseByID: " + err.Error()) + if models.IsErrProtectedTagName(err) { + ctx.Flash.Error(ctx.Tr("repo.release.tag_name_protected")) + } else { + ctx.Flash.Error("DeleteReleaseByID: " + err.Error()) + } } else { if isDelTag { ctx.Flash.Success(ctx.Tr("repo.release.deletion_tag_success")) |