mirror of https://github.com/jumpserver/jumpserver
fix: 修改企业微信&钉钉一些小问题和翻译
parent
ac5f2c560d
commit
3eba92548b
|
@ -2,7 +2,7 @@ import urllib
|
||||||
|
|
||||||
from django.http.response import HttpResponseRedirect
|
from django.http.response import HttpResponseRedirect
|
||||||
from django.utils.decorators import method_decorator
|
from django.utils.decorators import method_decorator
|
||||||
from django.utils.translation import ugettext as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
from django.views.decorators.cache import never_cache
|
from django.views.decorators.cache import never_cache
|
||||||
from django.views.generic import TemplateView
|
from django.views.generic import TemplateView
|
||||||
from django.views import View
|
from django.views import View
|
||||||
|
|
|
@ -2,7 +2,7 @@ import urllib
|
||||||
|
|
||||||
from django.http.response import HttpResponseRedirect
|
from django.http.response import HttpResponseRedirect
|
||||||
from django.utils.decorators import method_decorator
|
from django.utils.decorators import method_decorator
|
||||||
from django.utils.translation import ugettext as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
from django.views.decorators.cache import never_cache
|
from django.views.decorators.cache import never_cache
|
||||||
from django.views.generic import TemplateView
|
from django.views.generic import TemplateView
|
||||||
from django.views import View
|
from django.views import View
|
||||||
|
|
Binary file not shown.
|
@ -8,7 +8,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: JumpServer 0.3.3\n"
|
"Project-Id-Version: JumpServer 0.3.3\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2021-05-19 14:48+0800\n"
|
"POT-Creation-Date: 2021-05-19 16:27+0800\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: ibuler <ibuler@qq.com>\n"
|
"Last-Translator: ibuler <ibuler@qq.com>\n"
|
||||||
"Language-Team: JumpServer team<ibuler@qq.com>\n"
|
"Language-Team: JumpServer team<ibuler@qq.com>\n"
|
||||||
|
@ -2146,13 +2146,9 @@ msgstr "邮件已经发送{}, 请检查"
|
||||||
msgid "Welcome to the JumpServer open source Bastion Host"
|
msgid "Welcome to the JumpServer open source Bastion Host"
|
||||||
msgstr "欢迎使用JumpServer开源堡垒机"
|
msgstr "欢迎使用JumpServer开源堡垒机"
|
||||||
|
|
||||||
#: settings/api/dingtalk.py:29
|
#: settings/api/dingtalk.py:36 settings/api/wecom.py:36
|
||||||
msgid "AppSecret is required"
|
msgid "Test success"
|
||||||
msgstr "AppSecret 是必须的"
|
msgstr "测试成功"
|
||||||
|
|
||||||
#: settings/api/dingtalk.py:35 settings/api/wecom.py:35
|
|
||||||
msgid "OK"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: settings/api/ldap.py:189
|
#: settings/api/ldap.py:189
|
||||||
msgid "Get ldap users is None"
|
msgid "Get ldap users is None"
|
||||||
|
@ -2162,10 +2158,6 @@ msgstr "获取 LDAP 用户为 None"
|
||||||
msgid "Imported {} users successfully"
|
msgid "Imported {} users successfully"
|
||||||
msgstr "导入 {} 个用户成功"
|
msgstr "导入 {} 个用户成功"
|
||||||
|
|
||||||
#: settings/api/wecom.py:29
|
|
||||||
msgid "Secret is required"
|
|
||||||
msgstr "Secret 是必须的"
|
|
||||||
|
|
||||||
#: settings/models.py:123 users/templates/users/reset_password.html:29
|
#: settings/models.py:123 users/templates/users/reset_password.html:29
|
||||||
msgid "Setting"
|
msgid "Setting"
|
||||||
msgstr "设置"
|
msgstr "设置"
|
||||||
|
@ -3096,7 +3088,7 @@ msgstr "测试成功"
|
||||||
msgid "Test failure: Account invalid"
|
msgid "Test failure: Account invalid"
|
||||||
msgstr "测试失败: 账户无效"
|
msgstr "测试失败: 账户无效"
|
||||||
|
|
||||||
#: terminal/api/terminal.py:38 terminal/api/terminal.py:43
|
#: terminal/api/terminal.py:39
|
||||||
msgid "Have online sessions"
|
msgid "Have online sessions"
|
||||||
msgstr "有在线会话"
|
msgstr "有在线会话"
|
||||||
|
|
||||||
|
@ -5049,6 +5041,12 @@ msgstr "旗舰版"
|
||||||
msgid "Community edition"
|
msgid "Community edition"
|
||||||
msgstr "社区版"
|
msgstr "社区版"
|
||||||
|
|
||||||
|
#~ msgid "AppSecret is required"
|
||||||
|
#~ msgstr "AppSecret 是必须的"
|
||||||
|
|
||||||
|
#~ msgid "Secret is required"
|
||||||
|
#~ msgstr "Secret 是必须的"
|
||||||
|
|
||||||
#~ msgid "Corporation ID(corpid)"
|
#~ msgid "Corporation ID(corpid)"
|
||||||
#~ msgstr "企业 ID(CorpId)"
|
#~ msgstr "企业 ID(CorpId)"
|
||||||
|
|
||||||
|
|
|
@ -25,13 +25,18 @@ class DingTalkTestingAPI(GenericAPIView):
|
||||||
|
|
||||||
if not dingtalk_appsecret:
|
if not dingtalk_appsecret:
|
||||||
secret = Setting.objects.filter(name='DINGTALK_APPSECRET').first()
|
secret = Setting.objects.filter(name='DINGTALK_APPSECRET').first()
|
||||||
if not secret:
|
if secret:
|
||||||
return Response(status=status.HTTP_400_BAD_REQUEST, data={'error': _('AppSecret is required')})
|
dingtalk_appsecret = secret.cleaned_value
|
||||||
dingtalk_appsecret = secret.cleaned_value
|
|
||||||
|
dingtalk_appsecret = dingtalk_appsecret or ''
|
||||||
|
|
||||||
try:
|
try:
|
||||||
dingtalk = DingTalk(appid=dingtalk_appkey, appsecret=dingtalk_appsecret, agentid=dingtalk_agentid)
|
dingtalk = DingTalk(appid=dingtalk_appkey, appsecret=dingtalk_appsecret, agentid=dingtalk_agentid)
|
||||||
dingtalk.send_text(['test'], 'test')
|
dingtalk.send_text(['test'], 'test')
|
||||||
return Response(status=status.HTTP_200_OK, data={'msg': _('OK')})
|
return Response(status=status.HTTP_200_OK, data={'msg': _('Test success')})
|
||||||
except APIException as e:
|
except APIException as e:
|
||||||
return Response(status=status.HTTP_400_BAD_REQUEST, data={'error': e.detail})
|
try:
|
||||||
|
error = e.detail['errmsg']
|
||||||
|
except:
|
||||||
|
error = e.detail
|
||||||
|
return Response(status=status.HTTP_400_BAD_REQUEST, data={'error': error})
|
||||||
|
|
|
@ -25,13 +25,18 @@ class WeComTestingAPI(GenericAPIView):
|
||||||
|
|
||||||
if not wecom_corpsecret:
|
if not wecom_corpsecret:
|
||||||
secret = Setting.objects.filter(name='WECOM_SECRET').first()
|
secret = Setting.objects.filter(name='WECOM_SECRET').first()
|
||||||
if not secret:
|
if secret:
|
||||||
return Response(status=status.HTTP_400_BAD_REQUEST, data={'error': _('Secret is required')})
|
wecom_corpsecret = secret.cleaned_value
|
||||||
wecom_corpsecret = secret.cleaned_value
|
|
||||||
|
wecom_corpsecret = wecom_corpsecret or ''
|
||||||
|
|
||||||
try:
|
try:
|
||||||
wecom = WeCom(corpid=wecom_corpid, corpsecret=wecom_corpsecret, agentid=wecom_agentid)
|
wecom = WeCom(corpid=wecom_corpid, corpsecret=wecom_corpsecret, agentid=wecom_agentid)
|
||||||
wecom.send_text(['test'], 'test')
|
wecom.send_text(['test'], 'test')
|
||||||
return Response(status=status.HTTP_200_OK, data={'msg': _('OK')})
|
return Response(status=status.HTTP_200_OK, data={'msg': _('Test success')})
|
||||||
except APIException as e:
|
except APIException as e:
|
||||||
return Response(status=status.HTTP_400_BAD_REQUEST, data={'error': e.detail})
|
try:
|
||||||
|
error = e.detail['errmsg']
|
||||||
|
except:
|
||||||
|
error = e.detail
|
||||||
|
return Response(status=status.HTTP_400_BAD_REQUEST, data={'error': error})
|
||||||
|
|
Loading…
Reference in New Issue