mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-07-05 19:16:37 +00:00
fix: Import failed but no prompt message (#14966)
* fix: Import failed but no prompt message * fix: Prompt message --------- Co-authored-by: halo <wuyihuangw@gmail.com>
This commit is contained in:
parent
9cd1619990
commit
180303ccb4
@ -6197,7 +6197,7 @@ msgid "Get ldap users is None"
|
||||
msgstr ""
|
||||
|
||||
#: settings/ws.py:205
|
||||
msgid "Imported {} users successfully (Organization: {})"
|
||||
msgid "Total {}, success {}, failure {}"
|
||||
msgstr ""
|
||||
|
||||
#: templates/_csv_import_export.html:8
|
||||
|
@ -6295,8 +6295,8 @@ msgid "Get ldap users is None"
|
||||
msgstr "获取 LDAP 用户为 None"
|
||||
|
||||
#: settings/ws.py:205
|
||||
msgid "Imported {} users successfully (Organization: {})"
|
||||
msgstr "成功导入 {} 个用户 ( 组织: {} )"
|
||||
msgid "Total {}, success {}, failure {}"
|
||||
msgstr "总共 {},成功 {},失败 {}"
|
||||
|
||||
#: templates/_csv_import_export.html:8
|
||||
msgid "Export"
|
||||
|
@ -193,16 +193,14 @@ class LdapWebsocket(AsyncJsonWebsocketConsumer):
|
||||
users = self.get_ldap_users(username_list, cache_police)
|
||||
if users is None:
|
||||
msg = _('Get ldap users is None')
|
||||
|
||||
else:
|
||||
orgs = self.get_orgs(org_ids)
|
||||
new_users, error_msg = LDAPImportUtil().perform_import(users, orgs)
|
||||
if error_msg:
|
||||
msg = error_msg
|
||||
|
||||
count = users if users is None else len(users)
|
||||
orgs_name = ', '.join([str(org) for org in orgs])
|
||||
_new_users, error_msg = LDAPImportUtil().perform_import(users, orgs)
|
||||
ok = True
|
||||
msg = _('Imported {} users successfully (Organization: {})').format(count, orgs_name)
|
||||
success_count = len(users) - len(error_msg)
|
||||
msg = _('Total {}, success {}, failure {}').format(
|
||||
len(users), success_count, len(error_msg)
|
||||
)
|
||||
except Exception as e:
|
||||
msg = str(e)
|
||||
return ok, msg
|
||||
|
Loading…
Reference in New Issue
Block a user