Commit 7c7a9472 authored by zhanglu's avatar zhanglu

Merge branch 'yingjie/ins_account_exist' into 'test'

Yingjie/ins account exist

See merge request !19
parents a29f0313 64f654a6
......@@ -18,4 +18,5 @@ urlpatterns = [
# user
url(r'^v1/user/shadow/list$', user.ShadowUserList.as_view(), name='create_tag_for_batch'),
url(r'^v1/validate_3party_account$', user.Validate3PartyAccount.as_view(), name='validate_3party_account$'),
]
......@@ -93,11 +93,20 @@ class Sensitive(object):
if not data or "detail" in data: # 程序出错啦
return
action = data.get("result", {}).get("action", 0)
result = data.get("result", {})
if result:
action = result.get("action", 0)
else:
action = 0
if action == 0 or action == 1: # "通过"
return []
lables = data.get("result", {}).get("labels", [])
if result:
lables = result.get("labels", [])
else:
lables = []
for lable in lables:
hints.extend(lable.get('details', {}).get("hint"))
......
import json
from api.views.base_view import BaseView, get_offset_count
......@@ -38,3 +40,22 @@ class ShadowUserList(BaseView):
}
return self.ok(data=result)
class Validate3PartyAccount(BaseView):
"""
验证三方账号是否已绑定过
"""
def post(self, request):
_ids = request.POST.get("account_ids") or '[]'
account_ids = json.loads(_ids)
err, _data = self.call_rpc(
"venus/community/validate_has_bind_3party_account",
bind_account_ids=account_ids
)
if err:
return self.error(err)
data = {account_id: _data.get(account_id, False) for account_id in account_ids}
return self.ok(data=data)
......@@ -20,6 +20,6 @@ git+ssh://git@git.wanmeizhensuo.com/backend/gm-config.git@v0.1.2#egg=gm-config==
git+ssh://git@git.wanmeizhensuo.com/system/gm-tracer.git@v0.1.2
git+ssh://git@git.wanmeizhensuo.com/backend/gm-types.git@master
git+ssh://git@git.wanmeizhensuo.com/backend/gm-shield.git@1.0.0
git+ssh://git@git.wanmeizhensuo.com/alpha/alpha-types.git@dev
git+ssh://git@git.wanmeizhensuo.com/alpha/alpha-types.git@master
git+ssh://git@git.wanmeizhensuo.com/backend/gm-protocol.git@master
git+ssh://git@git.wanmeizhensuo.com/backend/gm-upload.git@v0.74
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