Commit a42d1344 authored by zhanglu's avatar zhanglu

Merge branch 'hotfix/strip' into 'test'

Hotfix/strip

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