mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-22 10:13:32 +00:00
## Issue Gitea does not display a clear error message when a user tries to create a cleanup rule for a package type that already has an existing cleanup rule. Although the duplicate rule is detected, the user is not informed why the cleanup rule cannot be created. ## Solution Add a user-facing error message when a cleanup rule already exists for the selected package type. Also add an integration test to verify that the appropriate error message is displayed when attempting to create a duplicate cleanup rule. Fixes #37820
This commit is contained in:
@@ -117,6 +117,7 @@ func performRuleEditPost(ctx *context.Context, owner *user_model.User, pcr *pack
|
||||
return
|
||||
} else if has {
|
||||
ctx.Data["Err_Type"] = true
|
||||
ctx.Flash.Error(ctx.Tr("packages.owner.settings.cleanuprules.type.already_exists"), true)
|
||||
ctx.HTML(http.StatusOK, template)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user