perf: 优化一下
@ -16,9 +16,7 @@ class DeviceTypes(BaseType):
'charset_enabled': False,
'domain_enabled': True,
'su_enabled': True,
'su_methods': [
{'name': 'enable', 'id': 'enable'},
]
'su_methods': ['enable']
}
@ -19,10 +19,7 @@ class HostTypes(BaseType):
'charset': 'utf-8', # default
{'name': 'sudo su -', 'id': 'sudo'},
{'name': 'su -', 'id': 'su'}
],
'su_methods': ['sudo', 'su'],
},
cls.WINDOWS: {
'su_enabled': False,
@ -14,6 +14,8 @@ def migrate_platform_protocol_primary(apps, schema_editor):
for platform in platforms:
p = platform.protocols.first()
if not p:
continue
p.primary = True
p.save()