perf: 优化 protocols

pull/10032/head
ibuler 2 years ago
parent 59d9572d07
commit aca0d62feb

@ -131,7 +131,6 @@ class PlatformSerializer(WritableNestedModelSerializer):
primary = [p for p in protocols if p.get('primary')]
if not primary:
protocols[0]['primary'] = True
protocols[0]['default'] = False
# 这里不设置不行write_nested 不使用 validated 中的
self.initial_data['protocols'] = protocols
return protocols

Loading…
Cancel
Save