Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
saturn
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpha
saturn
Commits
01ec73a4
Commit
01ec73a4
authored
Feb 27, 2019
by
zhanglu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test' into 'master'
Test See merge request
!31
parents
35156abe
a42d1344
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
14 deletions
+4
-14
user.py
api/views/user.py
+2
-12
user.py
libs/user.py
+2
-2
No files found.
api/views/user.py
View file @
01ec73a4
...
...
@@ -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
}
...
...
libs/user.py
View file @
01ec73a4
...
...
@@ -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/user
info_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
[]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment