mirror of
https://github.com/veops/cmdb.git
synced 2025-08-07 18:00:54 +08:00
fix: auth config (#318)
This commit is contained in:
@@ -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())
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user