From aaba35a01de38d4fae792f1b92a331d63beac0f6 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Thu, 7 Dec 2023 00:22:34 +0000 Subject: [PATCH] improve --- options/locale/locale_en-US.ini | 2 ++ routers/web/user/setting/account.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index f7a9584c7277e..a24b6b5b4a107 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -589,6 +589,8 @@ org_still_own_packages = "This organization still owns one or more packages, del target_branch_not_exist = Target branch does not exist. +cannot_delete_self = You cannot delete yourself when you are an admin. Please remove your admin privileges first. + [user] change_avatar = Change your avatar… joined_on = Joined on %s diff --git a/routers/web/user/setting/account.go b/routers/web/user/setting/account.go index d53451c16796c..41d4042b803a6 100644 --- a/routers/web/user/setting/account.go +++ b/routers/web/user/setting/account.go @@ -248,7 +248,7 @@ func DeleteAccount(ctx *context.Context) { // admin should not delete themself if ctx.Doer.IsAdmin { - ctx.Flash.Error(ctx.Tr("admin.users.cannot_delete_self")) + ctx.Flash.Error(ctx.Tr("form.cannot_delete_self")) ctx.Redirect(setting.AppSubURL + "/user/settings/account") return }