mirror of https://github.com/veops/cmdb.git
fix: auth config (#318)
This commit is contained in:
parent
0806f2ed73
commit
4a92d95d2f
|
@ -32,11 +32,10 @@ class AuthConfigView(APIView):
|
||||||
abort(400, ErrFormat.not_support_auth_type.format(auth_type))
|
abort(400, ErrFormat.not_support_auth_type.format(auth_type))
|
||||||
|
|
||||||
params = request.json
|
params = request.json
|
||||||
|
data = params.get('data', {})
|
||||||
if auth_type in cli.common_type_list:
|
if auth_type in cli.common_type_list:
|
||||||
params['encrypt'] = False
|
data['encrypt'] = False
|
||||||
cli.create(**params)
|
cli.create(data)
|
||||||
else:
|
|
||||||
cli.create(params.get('data', {}))
|
|
||||||
|
|
||||||
return self.jsonify(params)
|
return self.jsonify(params)
|
||||||
|
|
||||||
|
@ -55,9 +54,8 @@ class AuthConfigViewWithId(APIView):
|
||||||
data = params.get('data', {})
|
data = params.get('data', {})
|
||||||
if auth_type in cli.common_type_list:
|
if auth_type in cli.common_type_list:
|
||||||
data['encrypt'] = False
|
data['encrypt'] = False
|
||||||
res = cli.update(_id, data)
|
|
||||||
else:
|
res = cli.update(_id, data)
|
||||||
res = cli.update(_id, data)
|
|
||||||
|
|
||||||
return self.jsonify(res.to_dict())
|
return self.jsonify(res.to_dict())
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue