Commit fc58906b authored by BaiJiangJie's avatar BaiJiangJie

[Update] 修改翻译信息

parent e0d7a0e2
This diff is collapsed.
...@@ -104,7 +104,7 @@ class LDAPTestingAPI(APIView): ...@@ -104,7 +104,7 @@ class LDAPTestingAPI(APIView):
try: try:
json.loads(attr_map) json.loads(attr_map)
except json.JSONDecodeError: except json.JSONDecodeError:
return Response({"error": "AUTH_LDAP_USER_ATTR_MAP not valid"}, status=401) return Response({"error": _("LDAP attr map not valid")}, status=401)
config = self.get_ldap_config(serializer) config = self.get_ldap_config(serializer)
util = LDAPServerUtil(config=config) util = LDAPServerUtil(config=config)
...@@ -221,14 +221,14 @@ class LDAPUserImportAPI(APIView): ...@@ -221,14 +221,14 @@ class LDAPUserImportAPI(APIView):
return Response({'error': str(e)}, status=401) return Response({'error': str(e)}, status=401)
if users is None: if users is None:
return Response({'msg': 'Get ldap users is None'}, status=401) return Response({'msg': _('Get ldap users is None')}, status=401)
errors = LDAPImportUtil().perform_import(users) errors = LDAPImportUtil().perform_import(users)
if errors: if errors:
return Response({'errors': errors}, status=401) return Response({'errors': errors}, status=401)
count = users if users is None else len(users) count = users if users is None else len(users)
return Response({'msg': 'Imported {} users successfully'.format(count)}) return Response({'msg': _('Imported {} users successfully').format(count)})
class LDAPCacheRefreshAPI(generics.RetrieveAPIView): class LDAPCacheRefreshAPI(generics.RetrieveAPIView):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment