Commit b680f337 authored by zhanglu's avatar zhanglu

fix

parent 10c97ce3
......@@ -3,7 +3,7 @@ import json
import json
from api.views.base_view import BaseView, get_offset_count
from libs.user import get_user_by_names
from libs.user import user_exists_by_names
from alpha_types.venus.error import ERROR as CODES
......@@ -94,17 +94,7 @@ class Validate3PartyOrAccount(BaseView):
if not names:
return self.error(self.get_ErrorInfo(CODES.PARAMS_INCOMPLETE))
user_list = get_user_by_names(names=names)
account_users = {}
for name in names:
for _, user in user_list.items():
if user["nick_name"].strip() != name.strip():
continue
account_users[name] = True
break
account_users = user_exists_by_names(names=names)
users = {name: account_users.get(name, False) for name in names}
......
......@@ -46,12 +46,12 @@ def get_user_by_ids(user_ids):
return users_info
def get_user_by_names(names):
def user_exists_by_names(names):
"""获取用户信息"""
try:
rpc = get_current_rpc_invoker()
users_info = rpc["venus/account/user/userinfo_list_by_name"](names=names).unwrap()
users_info = rpc["venus/account/user/user_exists_by_names"](names=names).unwrap()
except Exception as e:
raise Exception(e)
return []
......
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