perf: 修改协议创建时一些默认值

pull/9798/head
ibuler 2023-02-27 19:48:07 +08:00
parent 86dab4fc6e
commit c602bf7224
1 changed files with 3 additions and 2 deletions

View File

@ -306,10 +306,11 @@ class AllTypes(ChoicesMixin):
protocols_data = deepcopy(default_protocols)
if _protocols:
protocols_data = [p for p in protocols_data if p['name'] in _protocols]
for p in protocols_data:
setting = _protocols_setting.get(p['name'], {})
p['required'] = p.pop('required', False)
p['default'] = p.pop('default', False)
p['required'] = setting.pop('required', False)
p['default'] = setting.pop('default', False)
p['setting'] = {**p.get('setting', {}), **setting}
platform_data = {