diff --git a/apps/locale/ja/LC_MESSAGES/django.mo b/apps/locale/ja/LC_MESSAGES/django.mo index d94d92000..52b16b3bd 100644 --- a/apps/locale/ja/LC_MESSAGES/django.mo +++ b/apps/locale/ja/LC_MESSAGES/django.mo @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c756a62144f20cbfa767a8afa63cfe3e01f65041e0ebd121533ad1411a034623 -size 125910 +oid sha256:f2c88ade4bfae213bdcdafad656af73f764e3b1b3f2b0c59aa39626e967730ca +size 125911 diff --git a/apps/locale/ja/LC_MESSAGES/django.po b/apps/locale/ja/LC_MESSAGES/django.po index 690aa7d3f..8aa00bb46 100644 --- a/apps/locale/ja/LC_MESSAGES/django.po +++ b/apps/locale/ja/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-20 16:23+0800\n" +"POT-Creation-Date: 2022-04-20 16:35+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -2890,16 +2890,16 @@ msgstr "タスク内容の更新: {}" msgid "The current organization ({}) cannot be deleted" msgstr "現在の組織 ({}) は削除できません" -#: orgs/api.py:77 -msgid "The organization have resource ({}) cannot be deleted" -msgstr "組織のリソース ({}) は削除できません" - -#: orgs/api.py:83 +#: orgs/api.py:74 msgid "" "LDAP synchronization is set to the current organization. Please switch to " "another organization before deleting" msgstr "" -"LDAP同期は現在の組織に設定されます。削除する前に別の組織に切り替えてください" +"LDAP 同期は現在の組織に設定されます。削除する前に別の組織に切り替えてください" + +#: orgs/api.py:83 +msgid "The organization have resource ({}) cannot be deleted" +msgstr "組織のリソース ({}) は削除できません" #: orgs/apps.py:7 rbac/tree.py:114 msgid "App organizations" @@ -4250,104 +4250,104 @@ msgstr "XRDPの有効化" msgid "Enable KoKo SSH" msgstr "KoKo SSHの有効化" -#: settings/utils/ldap.py:417 +#: settings/utils/ldap.py:419 msgid "ldap:// or ldaps:// protocol is used." msgstr "ldap:// または ldaps:// プロトコルが使用されます。" -#: settings/utils/ldap.py:428 +#: settings/utils/ldap.py:430 msgid "Host or port is disconnected: {}" msgstr "ホストまたはポートが切断されました: {}" -#: settings/utils/ldap.py:430 +#: settings/utils/ldap.py:432 msgid "The port is not the port of the LDAP service: {}" msgstr "ポートはLDAPサービスのポートではありません: {}" -#: settings/utils/ldap.py:432 +#: settings/utils/ldap.py:434 msgid "Please add certificate: {}" msgstr "証明書を追加してください: {}" -#: settings/utils/ldap.py:436 settings/utils/ldap.py:463 -#: settings/utils/ldap.py:493 settings/utils/ldap.py:521 +#: settings/utils/ldap.py:438 settings/utils/ldap.py:465 +#: settings/utils/ldap.py:495 settings/utils/ldap.py:523 msgid "Unknown error: {}" msgstr "不明なエラー: {}" -#: settings/utils/ldap.py:450 +#: settings/utils/ldap.py:452 msgid "Bind DN or Password incorrect" msgstr "DNまたはパスワードのバインドが正しくありません" -#: settings/utils/ldap.py:457 +#: settings/utils/ldap.py:459 msgid "Please enter Bind DN: {}" msgstr "バインドDN: {} を入力してください" -#: settings/utils/ldap.py:459 +#: settings/utils/ldap.py:461 msgid "Please enter Password: {}" msgstr "パスワードを入力してください: {}" -#: settings/utils/ldap.py:461 +#: settings/utils/ldap.py:463 msgid "Please enter correct Bind DN and Password: {}" msgstr "正しいバインドDNとパスワードを入力してください: {}" -#: settings/utils/ldap.py:479 +#: settings/utils/ldap.py:481 msgid "Invalid User OU or User search filter: {}" msgstr "無効なユーザー OU またはユーザー検索フィルター: {}" -#: settings/utils/ldap.py:510 +#: settings/utils/ldap.py:512 msgid "LDAP User attr map not include: {}" msgstr "LDAP ユーザーattrマップは含まれません: {}" -#: settings/utils/ldap.py:517 +#: settings/utils/ldap.py:519 msgid "LDAP User attr map is not dict" msgstr "LDAPユーザーattrマップはdictではありません" -#: settings/utils/ldap.py:536 +#: settings/utils/ldap.py:538 msgid "LDAP authentication is not enabled" msgstr "LDAP 認証が有効になっていない" -#: settings/utils/ldap.py:554 +#: settings/utils/ldap.py:556 msgid "Error (Invalid LDAP server): {}" msgstr "エラー (LDAPサーバーが無効): {}" -#: settings/utils/ldap.py:556 +#: settings/utils/ldap.py:558 msgid "Error (Invalid Bind DN): {}" msgstr "エラー (DNのバインドが無効): {}" -#: settings/utils/ldap.py:558 +#: settings/utils/ldap.py:560 msgid "Error (Invalid LDAP User attr map): {}" msgstr "エラー (LDAPユーザーattrマップが無効): {}" -#: settings/utils/ldap.py:560 +#: settings/utils/ldap.py:562 msgid "Error (Invalid User OU or User search filter): {}" msgstr "エラー (ユーザーOUまたはユーザー検索フィルターが無効): {}" -#: settings/utils/ldap.py:562 +#: settings/utils/ldap.py:564 msgid "Error (Not enabled LDAP authentication): {}" msgstr "エラー (LDAP認証が有効化されていません): {}" -#: settings/utils/ldap.py:564 +#: settings/utils/ldap.py:566 msgid "Error (Unknown): {}" msgstr "エラー (不明): {}" -#: settings/utils/ldap.py:567 +#: settings/utils/ldap.py:569 msgid "Succeed: Match {} s user" msgstr "成功: {} 人のユーザーに一致" -#: settings/utils/ldap.py:600 +#: settings/utils/ldap.py:602 msgid "Authentication failed (configuration incorrect): {}" msgstr "認証に失敗しました (設定が正しくありません): {}" -#: settings/utils/ldap.py:602 +#: settings/utils/ldap.py:604 msgid "Authentication failed (before login check failed): {}" msgstr "認証に失敗しました (ログインチェックが失敗する前): {}" -#: settings/utils/ldap.py:604 +#: settings/utils/ldap.py:606 msgid "Authentication failed (username or password incorrect): {}" msgstr "認証に失敗しました (ユーザー名またはパスワードが正しくありません): {}" -#: settings/utils/ldap.py:606 +#: settings/utils/ldap.py:608 msgid "Authentication failed (Unknown): {}" msgstr "認証に失敗しました (不明): {}" -#: settings/utils/ldap.py:609 +#: settings/utils/ldap.py:611 msgid "Authentication success: {}" msgstr "認証成功: {}" diff --git a/apps/locale/zh/LC_MESSAGES/django.mo b/apps/locale/zh/LC_MESSAGES/django.mo index 4d43bfac0..915796d03 100644 --- a/apps/locale/zh/LC_MESSAGES/django.mo +++ b/apps/locale/zh/LC_MESSAGES/django.mo @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:529a9646db39920766ffbe95b0de79bf0539df9f5807b5e36294031d8c4c7842 -size 104164 +oid sha256:c75e0a1f2a047dac1374916c630bc0e8ef5ad5eea7518ffc21e93f747fc1235e +size 104165 diff --git a/apps/locale/zh/LC_MESSAGES/django.po b/apps/locale/zh/LC_MESSAGES/django.po index 37d3e85e0..79cb6c940 100644 --- a/apps/locale/zh/LC_MESSAGES/django.po +++ b/apps/locale/zh/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: JumpServer 0.3.3\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-20 16:23+0800\n" +"POT-Creation-Date: 2022-04-20 16:35+0800\n" "PO-Revision-Date: 2021-05-20 10:54+0800\n" "Last-Translator: ibuler \n" "Language-Team: JumpServer team\n" @@ -2855,15 +2855,15 @@ msgstr "更新任务内容: {}" msgid "The current organization ({}) cannot be deleted" msgstr "当前组织 ({}) 不能被删除" -#: orgs/api.py:77 -msgid "The organization have resource ({}) cannot be deleted" -msgstr "组织存在资源 ({}) 不能被删除" - -#: orgs/api.py:83 +#: orgs/api.py:74 msgid "" "LDAP synchronization is set to the current organization. Please switch to " "another organization before deleting" -msgstr "LDAP同步设置组织为当前组织,请切换其他组织后再进行删除操作" +msgstr "LDAP 同步设置组织为当前组织,请切换其他组织后再进行删除操作" + +#: orgs/api.py:83 +msgid "The organization have resource ({}) cannot be deleted" +msgstr "组织存在资源 ({}) 不能被删除" #: orgs/apps.py:7 rbac/tree.py:114 msgid "App organizations" @@ -4188,104 +4188,104 @@ msgstr "启用 XRDP 服务" msgid "Enable KoKo SSH" msgstr "启用 KoKo SSH" -#: settings/utils/ldap.py:417 +#: settings/utils/ldap.py:419 msgid "ldap:// or ldaps:// protocol is used." msgstr "使用 ldap:// 或 ldaps:// 协议" -#: settings/utils/ldap.py:428 +#: settings/utils/ldap.py:430 msgid "Host or port is disconnected: {}" msgstr "主机或端口不可连接: {}" -#: settings/utils/ldap.py:430 +#: settings/utils/ldap.py:432 msgid "The port is not the port of the LDAP service: {}" msgstr "端口不是LDAP服务端口: {}" -#: settings/utils/ldap.py:432 +#: settings/utils/ldap.py:434 msgid "Please add certificate: {}" msgstr "请添加证书" -#: settings/utils/ldap.py:436 settings/utils/ldap.py:463 -#: settings/utils/ldap.py:493 settings/utils/ldap.py:521 +#: settings/utils/ldap.py:438 settings/utils/ldap.py:465 +#: settings/utils/ldap.py:495 settings/utils/ldap.py:523 msgid "Unknown error: {}" msgstr "未知错误: {}" -#: settings/utils/ldap.py:450 +#: settings/utils/ldap.py:452 msgid "Bind DN or Password incorrect" msgstr "绑定DN或密码错误" -#: settings/utils/ldap.py:457 +#: settings/utils/ldap.py:459 msgid "Please enter Bind DN: {}" msgstr "请输入绑定DN: {}" -#: settings/utils/ldap.py:459 +#: settings/utils/ldap.py:461 msgid "Please enter Password: {}" msgstr "请输入密码: {}" -#: settings/utils/ldap.py:461 +#: settings/utils/ldap.py:463 msgid "Please enter correct Bind DN and Password: {}" msgstr "请输入正确的绑定DN和密码: {}" -#: settings/utils/ldap.py:479 +#: settings/utils/ldap.py:481 msgid "Invalid User OU or User search filter: {}" msgstr "不合法的用户OU或用户过滤器: {}" -#: settings/utils/ldap.py:510 +#: settings/utils/ldap.py:512 msgid "LDAP User attr map not include: {}" msgstr "LDAP属性映射没有包含: {}" -#: settings/utils/ldap.py:517 +#: settings/utils/ldap.py:519 msgid "LDAP User attr map is not dict" msgstr "LDAP属性映射不合法" -#: settings/utils/ldap.py:536 +#: settings/utils/ldap.py:538 msgid "LDAP authentication is not enabled" msgstr "LDAP认证没有启用" -#: settings/utils/ldap.py:554 +#: settings/utils/ldap.py:556 msgid "Error (Invalid LDAP server): {}" msgstr "错误 (不合法的LDAP服务器地址): {}" -#: settings/utils/ldap.py:556 +#: settings/utils/ldap.py:558 msgid "Error (Invalid Bind DN): {}" msgstr "错误(不合法的绑定DN): {}" -#: settings/utils/ldap.py:558 +#: settings/utils/ldap.py:560 msgid "Error (Invalid LDAP User attr map): {}" msgstr "错误(不合法的LDAP属性映射): {}" -#: settings/utils/ldap.py:560 +#: settings/utils/ldap.py:562 msgid "Error (Invalid User OU or User search filter): {}" msgstr "错误(不合法的用户OU或用户过滤器): {}" -#: settings/utils/ldap.py:562 +#: settings/utils/ldap.py:564 msgid "Error (Not enabled LDAP authentication): {}" msgstr "错误(没有启用LDAP认证): {}" -#: settings/utils/ldap.py:564 +#: settings/utils/ldap.py:566 msgid "Error (Unknown): {}" msgstr "错误(未知): {}" -#: settings/utils/ldap.py:567 +#: settings/utils/ldap.py:569 msgid "Succeed: Match {} s user" msgstr "成功匹配 {} 个用户" -#: settings/utils/ldap.py:600 +#: settings/utils/ldap.py:602 msgid "Authentication failed (configuration incorrect): {}" msgstr "认证失败(配置错误): {}" -#: settings/utils/ldap.py:602 +#: settings/utils/ldap.py:604 msgid "Authentication failed (before login check failed): {}" msgstr "认证失败(登录前检查失败): {}" -#: settings/utils/ldap.py:604 +#: settings/utils/ldap.py:606 msgid "Authentication failed (username or password incorrect): {}" msgstr "认证失败 (用户名或密码不正确): {}" -#: settings/utils/ldap.py:606 +#: settings/utils/ldap.py:608 msgid "Authentication failed (Unknown): {}" msgstr "认证失败: (未知): {}" -#: settings/utils/ldap.py:609 +#: settings/utils/ldap.py:611 msgid "Authentication success: {}" msgstr "认证成功: {}" diff --git a/apps/orgs/api.py b/apps/orgs/api.py index 0723790cd..7a3271c50 100644 --- a/apps/orgs/api.py +++ b/apps/orgs/api.py @@ -69,6 +69,12 @@ class OrgViewSet(BulkModelViewSet): msg = _('The current organization ({}) cannot be deleted').format(current_org) raise PermissionDenied(detail=msg) + if str(instance.id) == settings.AUTH_LDAP_SYNC_ORG_ID: + msg = _( + 'LDAP synchronization is set to the current organization. Please switch to another organization before deleting' + ) + raise PermissionDenied(detail=msg) + for model in org_related_models: data = self.get_data_from_model(instance, model) if not data: @@ -77,11 +83,6 @@ class OrgViewSet(BulkModelViewSet): 'The organization have resource ({}) cannot be deleted' ).format(model._meta.verbose_name) raise PermissionDenied(detail=msg) - if str(instance.id) == settings.AUTH_LDAP_SYNC_ORG_ID: - msg = _( - 'LDAP synchronization is set to the current organization. Please switch to another organization before deleting' - ) - raise PermissionDenied(detail=msg) super().perform_destroy(instance)