perf: 优化一下

pull/10036/head
ibuler 2 years ago
parent c6071740b1
commit 1e0a6b5072

@ -16,9 +16,7 @@ class DeviceTypes(BaseType):
'charset_enabled': False, 'charset_enabled': False,
'domain_enabled': True, 'domain_enabled': True,
'su_enabled': True, 'su_enabled': True,
'su_methods': [ 'su_methods': ['enable']
{'name': 'enable', 'id': 'enable'},
]
} }
} }

@ -19,10 +19,7 @@ class HostTypes(BaseType):
'charset': 'utf-8', # default 'charset': 'utf-8', # default
'domain_enabled': True, 'domain_enabled': True,
'su_enabled': True, 'su_enabled': True,
'su_methods': [ 'su_methods': ['sudo', 'su'],
{'name': 'sudo su -', 'id': 'sudo'},
{'name': 'su -', 'id': 'su'}
],
}, },
cls.WINDOWS: { cls.WINDOWS: {
'su_enabled': False, 'su_enabled': False,

@ -14,6 +14,8 @@ def migrate_platform_protocol_primary(apps, schema_editor):
for platform in platforms: for platform in platforms:
p = platform.protocols.first() p = platform.protocols.first()
if not p:
continue
p.primary = True p.primary = True
p.save() p.save()

Loading…
Cancel
Save